Avi Shukron
Avi Shukron

Reputation: 6118

Weird Behavior of Xcode when debugging on device

I have an app that i'm developing for a quit long time now, and is already in the appstore.

I'm currently working on updates to this app, and when i'm testing it on the device i'm experiencing a weird behavior: Every time i'm trying to install and debug the app from xcode, the app start running, but after 10 seconds or so the app is crashing with no reason.

The weirdest thing is that when i'm re-running the app directly from the device, everything work just fine without any crashes.

Needless to say that in the simulator everything is working as expected.

Any suggestions what is going on?

Upvotes: 2

Views: 477

Answers (2)

KingofHeaven
KingofHeaven

Reputation: 1205

Just check whether your using the Distribution certificate for debugging. If its then change into development certificate for Debugging.

Upvotes: 2

Julio Gorgé
Julio Gorgé

Reputation: 10106

Your app may be taking too long to start when attached to the debugger. Remember that on iOS every app must go through applicationDidFinishLaunching in less than 20 seconds, otherwise it's killed by the OS.

In your case I would review the workload that is going into the applicationDidFinishLaunching method of your app delegate (or any other static initialization of objects occurring before that). Also make sure you aren't running network checks whose timeout may exceed that 20 seconds window (e.g. don't do reachability tests).

Upvotes: 1

Related Questions