且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

重新启动应用程序时获取异常SIGKILL

更新时间:2023-11-20 20:07:10

这不是一个崩溃:只是XCode有延迟的反应你点击小红色减号。当您以这种方式终止应用程序时,操作系统会向您的进程发送SIGKILL信号,但XCode的调试器在重新启动应用程序之前不会看到SIGKILL。



您可以通过在调试器中点击Continue按钮来恢复这个崩溃。


I build and run a project in iPhone simulator. I send it to background by pressing the home button. Then I double press the home button to find my app in the background and tap it. It becomes active and the app continues to run. Here I got no problem no matter how many times I repeat this. Then I kill the process by tapping the little red minus sign on the app's icon. But if I again tap the app icon to relaunch it I get SIGKILL error and app crashes. What could be the reason for this? Could it be caused by my XCode preferences?

This isn't really a crash: It's just XCode having a delayed reaction to your tapping the little red minus sign. When you terminate your app this way, the operating system sends a SIGKILL signal to your process – but XCode's debugger doesn't "see" the SIGKILL until after you relaunch the app.

You can "recover" from this "crash" by hitting the Continue button in the debugger, incidentally.