Search code examples
androidgradleandroid-espressogradle-managed-device

Show android emulators when running tests via gradle managed devices


When running android espresso tests via gradle managed devices, i.e. by running:

./gradlew pixel4api30DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.aaa.bbb.ccc.Suites.TestSuite -Pandroid.experimental.androidTest.numManagedDeviceShards=3

Is it possible to have it display the emulators while running the tests so that you are able to see what is happening?


Solution

  • You can use the --enable-display switch:

    ./gradlew pixel4api30DebugAndroidTest --enable-display
    

    But keep in mind that this will not work with ATD images.