What's a reliable way to make an iOS app crash?

后端 未结 18 1754
無奈伤痛
無奈伤痛 2020-12-12 11:47

I want to test my app\'s crash reporting out in the field by deliberately having it crash when the user performs a particular action that a real user is unlikely to do accid

18条回答
  •  -上瘾入骨i
    2020-12-12 12:24

    Add a gesture recognizer to a view that recognizes a 10 finger tap (5 fingers for iPhone as 10 can get a bit crowded). The GR has a method attached to it that executes anyone of the previously mentioned surefire ways to get your app to crash. Most users are not going to lay 10 fingers down on your app, so you're safe from the general user accidentally causing the crash.

    However you should be able to use something like Testflight or just deploying it to personal devices and test in the wild before ever submitting it to Apple. Having a forced crash could get your app rejected by Apple.

提交回复
热议问题