简体   繁体   中英

Killing an app in Xcode simulator

It seems in iOS 4, because your app goes into the background, it remembers where you last were. When I quit my app by pressing home, and then click on it again in the simulator shortly after, it remembers where it was and AFAIK it is working.

When I kill the app by double tapping home, holding the icon of my app in the bottom, pressing the delete key, then clicking on the normal icon to start the app, the app immediately crashes. I get:

Thread 1: Program received signal: "SIGKILL". 

at the line

int retVal = UIApplicationMain(argc, argv, nil, nil);

The console just says:

[Switching to process 46794 thread 0x207]
sharedlibrary apply-load-rules all
Current language:  auto; currently objective-c

I'm not sure where to go to start debugging this. Thanks!

In my not so bast experience the simulator and XCode don't have great communication. The console does get all the outputs it should when you're running but once you switch to another App, close it, or whatever, nothing will work as expected.

When I run the an up from Xcode into a real iPhone, if you close it, Xcode will still lets you STOP it.

If the app actually crashes you should look into the crash logs.

You should also try using Instruments

To not get a crash on your device you need to disconnect it from your computer once the application has been copied over. Then you can exit it and restart it without issues.

Once you completely shut down the app, I think the debugger loses all communication with it. If the app is in the background the debugger still reattaches I think when you launch it. If you completely close the app on the phone, and wanted to debug and view it through the console in Xcode, you would need to start the app from Xcode again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM