How can I run a single instrumentation test with Gradle Android

Javier Manzano picture Javier Manzano · Jul 25, 2014 · Viewed 9.7k times · Source

I'm trying to run the tests with this line... but this launches all tests:

./gradlew -DconnectedAndroidTest.single=LandingActivityTests connectedAndroidTest

How can I launch a single test?

Answer

sschuberth picture sschuberth · Oct 28, 2015

Since Android Gradle plugin version 1.3.0 you can use

./gradlew -Pandroid.testInstrumentationRunnerArguments.class=your.package.LandingActivityTests connectedAndroidTest