iOS App Crashes after install but not when running from Xcode

I have an odd issue I'm trying to troubleshoot. I have an app that is deployed to our enterprise and works on almost all of our devices.

Lately, I have devices (very small number) where the app installs from our MDM and it crashes upon launch, it does not get past the launch screen. If I remove and reinstall the app from the MDM it still crashes.

I decided to put the devices in developer mode and if I run the App from Xcode on the device it works fine. If I stop it and run it right from the device it also works.

If I do a final build of the app and install it using "Devices and Simulators", the app crashes upon launch.

Using "Devices and Simulators" I check for crash log for the app and no file.

I am stumped as to whats going on.

Answered by DTS Engineer in 863634022

OK, thank you. So I do have an Enterprise account; on the device I installed the app by hand, I do have the trust setting, and it’s trusted. The app will launch and exit and just sit in the background.

To give you a scale, we deploy the application via MDM to our fleet, which is less than 10,000. We have been seeing devices more regularly where the app launches and exits right after seeing the splash screen.

I think the next step here is to reproduce the problem, collect a sysdiagnose (make sure you don't reboot the device until you've collected the log), then take a look at the console log to "see what happened". I don't know what you'll find, but the device WILL log anytime in choose/can't run an app.

This also seems to occur on newly enrolled devices. FYI, the devices are all supervised. One last data point. If I sign the app as AdHoc using another non-enterprise developer account, the app installs (did not use MDM) and launches and runs fine.

Sure. All of this sounds like a problem with the enterprise configuration. It's probably not the signing of individual apps (since that does work on "some" devices), so it's probably something about the configuration of the devices that is failing. With luck, the console log will tell you more. If that isn't helpful, then I think your best bet would be to reach out to AppleCare Enterprise, as this is exactly the kind of thing they're most experienced with.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Please post the crash log and I'll see what I can figure out.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I would love to post a crash log, but it does not generate one.

The closest thing I could find was one line in console log.

Bootstrapping failed for <FBApplicationProcess: 0xca45dd380; app<got.lnt.MyDevice>:<invalid>> with error: <NSError: 0xc9ea77b10; domain: RBSRequestErrorDomain; code: 5; "Launch failed."> { NSUnderlyingError = <NSError: 0xc9ea76700; domain: NSPOSIXErrorDomain; code: 85> { NSLocalizedDescription = Launchd job spawn failed; }; }

So, I decided to check another one of my applications on one of these devices and it wont launch either. Could the device(s) be missing a certificate?

I decided to put the devices in developer mode and if I run the App from Xcode on the device it works fine. If I stop it and run it right from the device it also works.

FYI, developer signed builds basically "always" work (at least immediately after installation) because the development signature actually includes a "list" of every device ID that build will run on. All our tools validate the target against that list before installing, which makes it nearly impossible to get a development build on to a device that won't run that build.

So, I decided to check another one of my applications on one of these devices and it wont launch either. Could the device(s) be missing a certificate?

Yes, that's possible, particularly if this is an isolated device and/or it hasn't been configured in "awhile". However, it could also be that you haven't actually "trusted" the app source. Take a look "Install custom enterprise apps on iOS, iPadOS, and visionOS" and see if that turns anything up.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

OK, thank you. So I do have an Enterprise account; on the device I installed the app by hand I do have the trust setting and its trusted. The app will launch and exit and just sit in the background.

To give you a scale we deploy the application via MDM to our fleet which is less than 10,000. We have been seeing devices more regularly where the app launches and exist right after seeing the splash screen.

This also seems to occur on newly enrolled devices. FYI, the devices are all supervised.

One last data point. If I sign the app as AdHoc using another non-enterprise developer account the app installs (did not use MDM) and launches and runs fine.

OK, thank you. So I do have an Enterprise account; on the device I installed the app by hand, I do have the trust setting, and it’s trusted. The app will launch and exit and just sit in the background.

To give you a scale, we deploy the application via MDM to our fleet, which is less than 10,000. We have been seeing devices more regularly where the app launches and exits right after seeing the splash screen.

I think the next step here is to reproduce the problem, collect a sysdiagnose (make sure you don't reboot the device until you've collected the log), then take a look at the console log to "see what happened". I don't know what you'll find, but the device WILL log anytime in choose/can't run an app.

This also seems to occur on newly enrolled devices. FYI, the devices are all supervised. One last data point. If I sign the app as AdHoc using another non-enterprise developer account, the app installs (did not use MDM) and launches and runs fine.

Sure. All of this sounds like a problem with the enterprise configuration. It's probably not the signing of individual apps (since that does work on "some" devices), so it's probably something about the configuration of the devices that is failing. With luck, the console log will tell you more. If that isn't helpful, then I think your best bet would be to reach out to AppleCare Enterprise, as this is exactly the kind of thing they're most experienced with.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

iOS App Crashes after install but not when running from Xcode
 
 
Q