Siu Chung Chan
Siu Chung Chan

Reputation: 1686

When I launch my app, it stucks in the iPhone apps screen for 4,5 seconds

My app is an enterprise app. When I click on the app icon, the icon is dimmed, and stucks for 4-5 seconds.( It depends, some users report it stuck for 10 seconds.)

I connect the device to look into the console. I found some exception is through. But no idea if it is related and what it really did. Any idea? enter image description here

Upvotes: 0

Views: 214

Answers (1)

Oleg
Oleg

Reputation: 518

Looks like your app has an issue with startup time. Apple says that 400 milliseconds is a good launch time. If your app loads more than 20 seconds iOS will kill the process. The main reasons of such issue can be:

  • A lot of frameworks in the app
  • Project has a lot of classes, categories
  • Project is written in Objective-C (Swift has optimized runtime)

Try to add the environment variable DYLD_PRINT_STATISTICS in Scheme: enter image description here

You will find in console launch time statistics: enter image description here

Also check -application:didFinishLaunchingWithOptions: method in AppDelegate. If you perform some heavy operations remove them. You can measure code execution time like described here or precise methods described here .

For more information take a look at:

Upvotes: 2

Related Questions