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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.