App runs in simulator but crashes on device after about 20 seconds
Another simulator v device issue has popped up. This time it was a bit strange. Running in the simulator everything ran correctly, running on the device from XCode again everything ran correctly however starting the app manually on the device after it was disconnected from my mac, after a number of seconds the app crashed. Reconnect to XCode and it ran perfectly. How does one solve this?
Thankfully Organizer in XCode (Menubar->Window->Organizer) shows each device which has been provisioned and has Device logs for each.
This shows very clearly why the app crashed.
Application Specific Information:
Raiblin.DecadeEngine failed to launch in time
Elapsed total CPU time (seconds): 21.310 (user 21.310, system 0.000), 53% CPU
Elapsed application CPU time (seconds): 19.936, 50% CPU
All assets for my game were loaded in ‘viewDidLoad’ which was taking too long, causing the app to crash. Initial setup should be completed in viewDidLoad (such as OpenGL. If OpenGL fails to initialize there isn’t much point in continuing, but resource loading should be completed in a background thread.