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\"
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.