I am using XCode 4.2 on MacOS Lion. When debugging an iPhone/iPad app in Simulator, I am using "Stop" button on XCode toolbar (Product | Stop) to exit the app. Very often after this, XCode opens main.m file, puts the execution pointer on UIApplicationMain call and says "Program received SIGKILL". In about a second after that it breaks off debug mode, so I can not debug this error. My app involves lots of threads, so, my guess is it can be related to resources being pulled out when threads are still working, or something like that. This may even be normal, and I do not care very much about this problem, because the app is being terminated anyway. But seeing this SIGKILL after every debug is really annoying. How can I debug it? Alternatively, is there a way to disable it?
EDIT: there's nothing in the console except the usual activity log (no crash details like with regular exceptions).
SIGKILL is what you are sending to the process when you stop the debugger. There isn't anything wrong, but sometimes it does show up and switch you to the main.m file which is useless and annoying.
To get around it, don't bother stopping the executable from Xcode. Just leave it running, and when you want to run again, just re-launch with the "Play" button and the previous task will be terminated anyway.
It seems to me that jrturton's solution doesn't really get around the problem. I'm specifically stopping the app so I can test saving data using NSUserDefaults.
My suggestion is to hit STOP right after running so that the debugger is no longer monitoring the app. Then you are free to close the app and reopen it as you wish. Doing this I was able to check that NSUserDefaults were being saved correctly without having to step through the debugger every time I killed and reopened the app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With