how to make my phonegap android app crash?

前端 未结 9 1342
萌比男神i
萌比男神i 2021-02-05 03:27

I am developing a crash reporter plugin for phonegap android apps. For the testing purpose, I have to make my application crash & \"Unfortunately, application has stopped\"

9条回答
  •  无人共我
    2021-02-05 03:35

    If an app would run like a webpage, a infinite loop might take some time to cause a crash, but should work. Just remember to remove it after testing. Because it causes an exception, and times out the program, the crash should be properly invoked if something possible harmful is used in it. Do something like this:

    while(true){ eval("9.99999e+5000 / Infinity"); }
    

    Because we aren't editing a variable, we will prevent the out of memory error.

    If this doesn't work, refer to @Aaron D's answer, and if that doesn't work, refer to @kumar's answer.

提交回复
热议问题