Running instrumentation tests

To run all instrumentation tests, use the following command line:

$ ./gradlew connectedAndroidTest 

Its precondition is to have a device connected or emulator running. If you have more than one device or emulator present, all of them will run tests.

To run the instrumentation test for the build variant, use the following command line:

$ ./gradlew connectedCompleteDebugAndroidTest 

This will trigger all instrumentation tests for the Connected flavor with the Debug build type.

Get Mastering Android Development with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.