iOS: how to trigger a user force-quit crash on iPhone?

喜欢而已 提交于 2019-12-12 10:27:21

问题


WWDC video(WWDC 2010 Session 317 - Understanding Crash Reports on iPhone OS) says error code 0xdeadfa11 in crash log means a user force-quit crash, but I've never seen this errer code. How to trigger a user force-quit crash?

EDIT: I would like knowing both the manual way and programmatical way :P


回答1:


Apparently there is no programmatical way to do it because the exception type is based on user activity.

In order to simulate the crash the apple docs says as follow

The exception code 0xdeadfa11 indicated that an application has been force quit by the user. Force quits occur when the user first holds down the On/Off button until "slide to power off" appears, then holds down the Home button. It's reasonable to assume that the user has done this because the application has become unresponsive, but it's not guaranteed - force quit will work on any application.

I have simulated this on iphone 5 (iOS 7) device and works fine.



来源:https://stackoverflow.com/questions/13907356/ios-how-to-trigger-a-user-force-quit-crash-on-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!