Skip to main content

(Android) Run tests using the emulator


Run any kind of tests (unit, instrumentation) on a local emulator instance.


  1. Add an AVD Manager Step. To customize the emulator, see the Step configuration.

    Using the AVD Manager Step

    The AVD Manager starts in the background, which can take several minutes. Because of that, we recommend adding the AVD Manager Step at the beginning of your Workflow (before Activate SSH key (RSA private key) Step and the Git Clone Step) to speed up your builds.

  2. Add a Android Build for UI Testing Step, and configure the required inputs.

  3. Add a Wait for Android emulator Step.

  4. Add an Android Instrumented Test Step, and configure the required inputs.

  5. Add an Export test results to Test Reports add-on Step with the following inputs:

    • The name of the testEmulator tests.

    • Test result base path$BITRISE_SOURCE_DIR/app/build/outputs/androidTest-results.

      You might want to adjust the path based on the module name(s) in your project.

    • Test result search pattern*.xml.

  6. Add a Deploy to Step that makes the test results available in the Test Reports add-on.


- avd-manager@1: {}
- android-build-for-ui-testing@0:
        - module: "$ANDROID_TESTING_MODULE"
        - variant: "$ANDROID_V_DEBUG"
- wait-for-android-emulator@1:
- android-instrumented-test@0: {}
- custom-test-results-export@0:
    - search_pattern: "*.xml"
    - base_path: $BITRISE_SOURCE_DIR/app/build/outputs/androidTest-results
    - test_name: Emulator tests
- deploy-to-bitrise-io@2: