Tarostar
Tarostar

Reputation: 1316

Working Xamarin iOS App Fails to Launch on iPhone 4 and 5 using Visual Studio 2015

The iOS only app launches fine in all simulators for both iOS 9.3 and iOS 10.2, from iPhone 5s to iPhone 7 Plus, as well as on iPad.

However, on iPhone 5 (and less importantly 4) neither the simulator or an actual iPhone 5 can launch the app. Breakpoints in the AppDelegate method "FinishedLaunching" or Application Main method are never hit.

What actually happens is that the static storyboard pre-launch image is displayed for a second and then closes. This repeats several times before it stops. Trying to launch the app from the icon has exactly the same effect. This happens for both iOS 9.3 and 10.2.

In the Debug console in Visual Studio is only the following which has given me nothing trying to find a solution:

Launching 'xxx' on 'iPhone 5 iOS 9.3'...
Launch failed. The app 'xxx' could not be launched on 'iPhone 5 iOS 9.3'. Error: An error occured on client IDB420719 while executing a reply for topic xvs/idb/4.2.0.719/launch-app. Please check the logs for more details.
The app has been terminated.

The simulator on the Mac has no logs for the crashes in ~/Library/Logs/DiagnosticReports (it does log other crashes for other versions so path is correct).

Everything on both PC and MAC are up-to-date with the latest.

I'm a bit stuck on how to dig further and baffled since it works great on iPhone5s+.

Suggestions to what I can try, where I can look and possible causes are greatly appreciated.

Upvotes: 1

Views: 1795

Answers (2)

Tarostar
Tarostar

Reputation: 1316

Thanks to Alan Clark's suggestion to look for the device output in the Mac Console I found the reported errors when the Simulator (for iPhone5) attempted to launch the app and I googled this to find the answer:

Unable to get pid for 'UIKitApplication:xxx[0xcc8a]': No such process (err 3)

The problem was the supported architecture in the project settings. When I created the project months ago this had been "i386", but this caused warnings on the iPhone 6 so I changed it to "x86_64". I didn't realise that iPhone5 and earlier require i386 architecture to run, so the correct setting is "i386 + x86_64".

See screenshot from the project properties (bottom of Project menu item) in visual studio.

Visual Studio 2015 Supported Architecture for Xamarin iOS

Also see Xamarin documentation on 32/64 bit Platform Considerations.

Upvotes: 6

RollRoll
RollRoll

Reputation: 8472

"Everything on both PC and MAC are up-to-date with the latest."

I don't know if you also meant Xamarin on mac and PC are the latest version.

Before trying running from xamarin, create an empty project on XCode on your mac. Try to run on your device to see if the issue persists.

Make sure you have the provisioning file on your mac in order to be able to run on your device.

Upvotes: 0

Related Questions