Test your app

Stay organized with collections Save and categorize content based on your preferences.

This section describes the various tools that help you create, configure, and run your tests from Android Studio or the command line.

If you want to learn more about the fundamentals of testing and how to write tests, see Test apps on Android.

There are different ways to run and configure your tests:

  • For basic testing needs, Android Studio includes features that help you create, run, and view results of tests all from the IDE. Using Studio, you can point and click in the app source code to create and run tests for specific classes or methods, use drop-down menus to configure multiple test devices, and interact with the Text Matrix tool window to visualize test results. For more information on how to use Android Studio to create and manage your tests, see Test in Android Studio.

  • For more fine-grained control, you can run tests from the command line. Command line testing provides a straightforward way to target specific modules, build variants, or combinations thereof. Running tests through the Android Debug Bridge (adb) shell allows for the most customization in terms of which tests you want to run. For more information, see Test from the command line.

  • For advanced testing needs, you may want to override default settings, configure Gradle options, or refactor your code so that tests are separated in their own module. For more information about how to set up your test configurations for special use cases, see Advanced test setup.

  • To test how your app behaves when your user interacts with it, you can use tools such as Espresso Test Recorder, App Crawler, Monkey Testing, and monkeyrunner.