简体   繁体   English

在Xcode模拟器中杀死一个应用程序

[英]Killing an app in Xcode simulator

It seems in iOS 4, because your app goes into the background, it remembers where you last were. 它似乎在iOS 4中,因为你的应用程序进入后台,它会记住你最后的位置。 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. 当我按下主页退出我的应用程序,然后在模拟器中再次点击它后,它会记住它的位置和AFAIK它正在工作。

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. 在我不那么麻烦的经历中,模拟器和XCode没有很好的沟通。 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. 当我从Xcode运行到真正的iPhone时,如果你关闭它,Xcode仍然会让你停止它。

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. 如果您完全关闭手机上的应用程序,并希望通过Xcode中的控制台进行调试和查看,则需要再次从Xcode启动应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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