Jason Robinson
Jason Robinson

Reputation: 31283

What Gradle commands are Android Studio running when I click Run?

When I click 'Run' in Android Studio, I want to know what specific Gradle command-line is being executed. Through the Gradle Console it shows you the results of what's being executed, but not the command-line task and arguments. I'm specifically interested in what the Gradle command-line arguments are when unit tests are ran on a specific package, method, or class.

Upvotes: 2

Views: 203

Answers (1)

Vesko
Vesko

Reputation: 3760

I haven't found a way to see the actual executed gradle command in Android Studio, however if you're only interested in running specific unit tests here's how.

To run all unit tests within a package:

./gradlew testAppDebug --tests="*.my.package.name.*"

Or a single class

./gradlew testAppDebug --tests="*.my.package.name.MyClassTest"

Or a single test method (in our case named simpleTest):

./gradlew testAppDebug --tests="*.my.package.name.MyClassTest.simpleTest"

Hope it helps :)

Upvotes: 1

Related Questions