What are the best ways to crash Android apps?

12,337

Solution 1

Start your application, carry out some actions, change the orientation multiple times, exit the application. Repeat the process again and again to discover any hidden memory leaks (use a memory profiler).

Use the monkey to find any possible ab-use cases that you have not considered (although he is not available on some Android devices).

From experience, the best way to really test your application is to find yourself a bunch of beta testers who have not been involved in the project (their actions will make you raise an eyebrow - 'You did what!?').

Solution 2

I'm listing below the ways of crashing app

  1. Try putting a Toast in thread.
  2. Change orientation while fetching data in RSS feed.
  3. Click Back button while using tabbar. (it crashes in custom tabbar)
  4. Click Back button on TabGroupActivity without overriding back function.

Solution 3

In addition to the excellent list by Maulik:

  • change screen orientation in any activity that spawns AsyncTasks

Solution 4

You need fast fingers :) just tap very fast on navigation proceed and back buttons, if you have them. I found a lot of crashes using this way.

Solution 5

If you are trying to crash intentionally to test services or how the app behaves after a crash then null context it is.

Toast.makeText(null, "Crashed before shown.", Toast.LENGTH_SHORT).show();
Share:
12,337
seibelj
Author by

seibelj

Updated on June 04, 2022

Comments

  • seibelj
    seibelj almost 2 years

    What are the best ways to cause Android apps to crash? We are trying to make our app as rock solid as possible.

    For my own contribution, if you have an app that uses network services, go into your app with wifi connected and then turn off wifi in various ways. For instance, walking out of range, or backgrounding the app and manually shutting wifi off, then foregrounding the app.