18

I am trying to deploy my Xamarin iOS app to iPhone. But it fails to deploy into iPhone devices where as it works fine in Simulators. I verified that Bundle Identifier and Provisioning Profiles are matching. Also I deployed another test app into iPhone devices using XCode using the same provisioning profiles. It is getting deployed successfully. Also approved the Developer as trusted in iPhone.

The Exception I see Visual Studio as below

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).

I see this is coming from my Mac Agent. Visual Studio says the App is terminated.

Saamer
  • 4,687
  • 1
  • 13
  • 55
Raja Ranganathan
  • 323
  • 1
  • 2
  • 11
  • I just noticed that it started fail to deploy in Simulators too. – Raja Ranganathan Jan 04 '17 at 20:11
  • 2
    I'd probably suggest deleting the 'bin' and 'obj' folders in your project, then clean and rebuild - see if that offers any improvement. – Alan Clark Jan 04 '17 at 23:19
  • 3
    The iOS Device log might provide better insight as to why the app is not running on device. There is a Device Log pane you can open in Xam Studio and Visual Studio to see the live device logs in real time. Open the device log pane, select the iOS device, then launch your app to the device while watching the log. The messages in the device log are often more informative about why an app fails to launch. – jgoldberger - MSFT Jan 05 '17 at 00:48
  • iOS Device didn't have any logs. But found the below log in mac Installing application bundle 'com.wk.taa.ios.authenticator' on 'iRajaPlus' Xamarin.Messaging.IDB.MTouch Information: 0 : [2017-01-04 18:19:22.2955] ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HvcYN6/extracted/WK.TAA.Mfa.OTPAuthenticator.iOS.app : 0xe800801c (No code signature found.) – Raja Ranganathan Jan 05 '17 at 02:22
  • 1
    It turned out to be a certificate issue. created new one and it started working again. – Raja Ranganathan Jan 29 '17 at 18:45
  • 6
    FWIW, to anyone else struggling with this: jgoldberger's mention of iOS Device log, in this case, means *the live device log as xamarin attempts to install on device*, as seen in View Pad "Device Log". This is a screen of information that will scroll past during that install. It is not the same as looking on your device later for logs - those are *crash* logs - not what you need. You'll need to select all / copy / paste from the *live* log stream to a text editor, then search it for messages just before the failure message. – ToolmakerSteve Mar 27 '17 at 19:14
  • For those wondering what to search for, try looking for "installd". Mine says "Info (8870) / installd(MobileSystemServices): 0x16dd67000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 78: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.v1FuGy/extracted/MyAppName.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)" – Jared Updike Dec 12 '22 at 23:37

4 Answers4

3

It is an indication that your device is not in your provisioning profile, or your provisioning profile is invalid.

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. They have no issues with you installing it on a simulator, so that you can't distribute apps without using the 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 the 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.

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. 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.

Saamer
  • 4,687
  • 1
  • 13
  • 55
1

Try to change Linker Behavior to Link SDK assemblies only

cahyo
  • 597
  • 2
  • 5
  • 14
0

Go to the iOS properties => iOS Build and set "Linker Behavior" to "Link Framework SDKs Only" and "Supported Architectures" to "ARMv7 + ARM64"

Luca Ziegler
  • 3,236
  • 1
  • 22
  • 39
0

Create blank project on your build mac host, or mac, xcode. Set bundle id to xamarin bundle id. Build and deploy from xcode, close and try again with xamarin.

ms2r
  • 170
  • 3
  • 17