Execute tests from the Android Studio IDE
The tests that you can run from the command line (Execute all tests from the command line with Gradle and Execute specific tests from the command line with Gradle) can also be run from within the IDE. This can be useful for investigating test failures with breakpoints or for running tests as you write the code.
- In Run > Edit Configurations, add a new test configuration.
-
Set the following parameters for the test configuration:
- Module: <app_name>
- Instrumentation runner: android.support.test.runner.AndroidJUnitRunner
- Save the configuration.
- Select the new configuration and Run or Debug.