Why iOS apps signed with development or enterprise certificates launch slower?
Asked Answered
I

5

19

I can't help noticing on my iPhone 5 that the apps that are signed using my development certificate and my company's enterprise distribution certificate takes about 4 seconds to launch or activate. This is the time taken between tapping the application's icon and seeing the launch image – which obviously does not include the application's initialization code.

It's an awkward 4 seconds in which the application's icon remains dimmed after being tapped and the home screen freezes (can't even scroll right/left).

What's weird is that it takes approximately the same amount of time to re-activate the application from the background (i.e launch the app, wait till it runs, press the home button, and then immediately tap the app's icon again).

Questions are:

  • What is causing this?
    • My gut feel blames Springboard trying to verify the signing certificates upon each tap of the application's icon. However I can't prove this.
  • How can I reduce this launch-freeze time? (if at all possible?)

I tested this using iOS 8.3 on iPhone 5

Ingham answered 12/4, 2015 at 12:8 Comment(3)
I notice this as well, but it's not quite 4 seconds. Maybe filing a radar will help.Piss
There are more compile-time optimizations used when you compile for distribution rather than for development, but since this delay can be noticed in both development and in enterprise deployment, this is not likely the cause.Piss
I had the same issue. Didn't realize it was because of Enterprise (at first, I thought maybe the device was faulty or too old for the latest OS). I tried building the simplest possible app (single view), then removed the storyboard altogether (no view), then edited the scheme to run in the "Release" configuration (instead if "Debug"), to no avail. I'm so glad I found this question (even if no definitive answer yet).Symbolism
S
10

In my case, I think it was due to the devices having literally a ton of different provisioning profiles installed in them (for some reason, the "Profiles" entry in the Settings app is no longer available... but they show in Window / Devices / Show Provisioning Profiles...).

In theory, you should have to delete all the profiles from within Xcode's "Devices" window. However -at least as of Xcode 6 in my environment- this is very unresponsive (either by clicking the menu's button or hitting the Delete key) to the point of almost beach-balling, and the displayed list itself sometimes seems to be very inconsistent from one plugging of the device to the next (perhaps it is cached? an Xcode bug?).


TL;DR:

So instead, I just reset my devices to factory settings ("Delete all settings and Data"), and now my apps launch immediately (iPad Air) and almost immediately (iPod Touch 5th Gen).

I believe (but this needs confirmation) that the reason why all those provisioning profiles where installed on the devices in the first place is that, in the Target's General/Identity pane I specified the "Team". Now, I have these settings:

  1. Target / General / Identity

    Bundle Ientifier: com.MyCompanyName.AppName

    Team: None

(Setting the team seems to cause Xcode to install all provisioning profiles from the developer portal into the device...?)

  1. Target / Build Settings / Code Signing

    Code Signing Identity: iOS Developer

    Provisioning Profile: Automatic

...and on Run, only one of my profiles (one of the Xcode-managed "iOS Team Provisioning Profile" ones) gets installed on the device.

Addendum: Searching the internet for "Xcode specify team why" yielded this documentation page by Apple on setting the Xcode Team. Hope it helps.


UPDATE: Still the same as of Xcode 7.x

Symbolism answered 22/7, 2015 at 6:35 Comment(8)
As a side note: on the iPad, I went from 4+ seconds to launch to "as fast as the factory apps" (Safari, etc.). Also, a timeout/failed to launch/Springboard crash issue taht happened very often when debugging, disappeared misteriosuly. On the older iPod touch, it still takes around half a second to launch my apps.Symbolism
I can't seem to find the list of Profiles in Xcode 6.4's "Devices" window.Ingham
Right click on device's row on the list (left pane), and right click (Alternatively, click the gear button at the bottom). Then choose "Show Provisioning Profiles".Symbolism
(ctrl-click instead of right click if your Mac is set to single-button mouse)Symbolism
I erased my phone however those profiles magically came back – although I didn't run any development apps on it nor restore from backup. I did signed in to iCloud and plugged it into iTunes to create a new backup. Any tips how to prevent those profiles from coming back?Ingham
No idea. You did NOT plug your phone to Xcode, yet all the profiles were downloaded to it?Symbolism
On a second thought, Xcode was running when I plug the phone in and I used Xcode to check the existence of those profiles – so that's probably how it got installed. However I did not try to run any apps using Xcode.Ingham
Syncing with iTunes is how I ended up in this situation. I had so many provisioning profiles on my device that Xcode couldn't even display them. It got so bad that sometimes springboard would crash after hanging for over a minute. I ended up using Apple Configurator to delete all the provisioning profiles and now my apps launch immediately.Pauperize
K
10

Delete all duplicate provisioning profiles on your device. You can do this in Xcode->Devices, than right click on your device "Show Provisioning Profiles...". In my case I had installed more than 300 different profiles.

After deploying again, my app launched immediately instead of waiting 5-8s each time.

Kablesh answered 30/8, 2015 at 17:47 Comment(2)
This fixed it for me as well. Watch for the 'right click' on your device. Took me a minute to figure out where to find the Show Provisioning ProfilesUngotten
It works for me but i have a doubt how the duplicate provisioning profiles affect my app launch time?Since app is signed with current provision profile and should check only this profile but not other duplicate profiles.Am confused on how its affecting.Suggest
D
2

Could it be that the device is checking non-appstore builds against a Certificate Revocation List? And that list is possibly online?

If the latter were true then you might get a faster launch by enabling Airplane Mode.

Dispatch answered 12/4, 2015 at 20:36 Comment(3)
The delay is still present in Airplane Mode.Ingham
That was my best guess. It seems strange that it would check the signature every time. You could experiment with timing larger binary launch times...Dispatch
My devices don't have cellular connectivity (iPad, iPod Touch) and they were not connected to any WiFi network, so everything was happening offline. I tried creating a WiFi network from my Mac and sharing it. Now they devices have WiFi, but it still takes about 4 seconds to launch (no change). Airplane mode didn't work here, either.Symbolism
R
0

I had a similar issue with my app. I was using Parse and FBLogin. I tried everything on this page. Then I tried turning off all launch options in Appdelegate and deleting Assets.xcassets folder, but to no avail. I finally backed up my info.plist file and copied over a plist file from an app that I knew was launching properly. That fixed the issue. Then I went back and recreated the plist file with contents from the older plist. I realized that App Transport Security Settings and LSApplicationQueriesSchemes were causing the issue. The app now works fine without those entries, but I will add them later if they are needed.

Romine answered 11/12, 2015 at 19:47 Comment(0)
B
0

I also had this issue,but no duplicate provisioning profiles on my device(ipad). then I found the ocsp causing the launch delay.

even Apple says in (Certificate validation)

"The OCSP response is cached on the device for the period of time specified by the OCSP server — currently, between three and seven days. "

But the OCSP appears after A few hours.

Bashee answered 1/7, 2016 at 9:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.