Skip Navigation

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.
  1. In 
    Run > Edit Configurations
    , add a new test configuration.
  2. Set the following parameters for the test configuration:
    • Module: 
      <app_name>
    • Instrumentation runner: android.support.test.runner.AndroidJUnitRunner
  3. Save the configuration.
  4. Select the new configuration and Run or Debug.
The tests will run and generate results. The IDE will show progress and results. If Debug was selected, you can insert breakpoints in the code.