简体   繁体   English

Xamarin 无法将 iOS 应用程序部署到 iOS 设备

[英]Xamarin fails to deploy iOS app to iOS Device

I am trying to deploy my Xamarin iOS app to iPhone.我正在尝试将我的 Xamarin iOS 应用程序部署到 iPhone。 But it fails to deploy into iPhone devices where as it works fine in Simulators.但它无法部署到 iPhone 设备中,因为它在模拟器中运行良好。 I verified that Bundle Identifier and Provisioning Profiles are matching.我验证了 Bundle Identifier 和 Provisioning Profiles 是匹配的。 Also I deployed another test app into iPhone devices using XCode using the same provisioning profiles.此外,我使用 XCode 使用相同的配置文件将另一个测试应用程序部署到 iPhone 设备中。 It is getting deployed successfully.它正在成功部署。 Also approved the Developer as trusted in iPhone.还批准开发人员在 iPhone 中受信任。

The Exception I see Visual Studio as below我看到 Visual Studio 的异常如下

error MT1006: Could not install the application '/Users/VarunRaja/Library/Caches/Xamarin/mtbs/builds/WK.TAA.Mfa.OTPAuthenticator.iOS/116dd0bfdd565dd44e1837c2280a6d94/bin/iPhoneSimulator/Debug/WK.TAA.Mfa.OTPAuthenticator.iOS.app' on the device 'Raja's iPhone': AMDeviceSecureInstallApplicationBundle returned: 0xe8000067 (kAMDAPIInternalError).错误 MT1006:无法安装应用程序 '/Users/VarunRaja/Library/Caches/Xamarin/mtbs/builds/WK.TAA.Mfa.OTPAuthenticator.iOS/116dd0bfdd565dd44e1837c2280a6d94/bin/DebugAutKimator.TAA.Mfa.OTPAuthenticator.设备“Raja 的 iPhone”上的 iOS.app':AMDeviceSecureInstallApplicationBundle 返回:0xe8000067 (kAMDAPIInternalError)。

I see this is coming from my Mac Agent.我看到这是来自我的 Mac 代理。 Visual Studio says the App is terminated. Visual Studio 表示应用程序已终止。

As mentioned here by Tim Wheeler , it is an indication that your device is not in your provisioning profile, or your provisioning profile is invalid.正如Tim Wheeler 在此处提到的,这表明您的设备不在您的配置文件中,或者您的配置文件无效。

Why?为什么?

Basically, iOS will not let you build the app on to the device for security purposes, unless you have registered the device to THAT particular app in the Apple Developer Portal.基本上,出于安全目的,iOS 不允许您将应用程序构建到设备上,除非您已将设备注册到 Apple Developer Portal 中的特定应用程序。 They have no issues with you installing it on a simulator, so that you can't distribute apps without using the App Store.他们对您在模拟器上安装它没有任何问题,因此您无法在不使用 App Store 的情况下分发应用程序。

Fix使固定

In order to fix this, you need to have Access to the Apple Developer Portal of the company under which the app is registered and then go to theCertificates, Identifiers and Profiles .为了解决这个问题,您需要访问注册应用程序的公司的Apple Developer Portal ,然后转到Certificates, Identifiers and Profiles

Go to the "Devices" tab and make sure your device is in the list.转到“设备”选项卡并确保您的设备在列表中。 Then go to "Profiles" tab, and you might see an "Invalid" status under the Expiration column of the Provisioning Profile.然后转到“配置文件”选项卡,您可能会在配置文件的过期列下看到“无效”状态。 Fix it , tap on your app's profile, ensure it includes your iPhone, downloaded the new one to the mac and install it. 修复它,点击您的应用程序的配置文件,确保它包含您的 iPhone,将新的下载到 Mac 并安装它。

Not fixed yet?还没修好?

If that was not the issue, it could be because you have multiple provisioning profiles installed.如果这不是问题,则可能是因为您安装了多个配置文件。 Visual Studio is usually set to Automatically determine the appropriate provisioning profile, and it could be using the wrong one if you have a few installed. Visual Studio 通常设置为自动确定适当的配置文件,如果您安装了一些配置文件,它可能会使用错误的配置文件。 You could delete the unneeded ones, or you can go to your iOS project settings, set the bundle signing to "Manual", then choose the valid profile.您可以删除不需要的,或者您可以转到您的 iOS 项目设置,将捆绑签名设置为“手动”,然后选择有效的配置文件。

转到 iOS 属性 => iOS Build 并将“Linker Behavior”设置为“Link Framework SDKs Only”并将“Supported Architectures”设置为“ARMv7 + ARM64”

尝试将链接器行为更改为仅链接 SDK 程序集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM