How can I see the gradle command executed when Android Studio runs a build configuration?
Asked Answered
P

1

7

Backstory:

  • Module A depends on Module B
  • Want to know the gradle command line execution when Android Studio runs the unit test package for Module A

This is important because I'm trying to compare how it differs from executing tests from command line with: ./gradlew :testDebug

You see, when running the test package from Android Studio my tests run correctly, but running with command line above gradle throws an exception.

The root of the problem is that when run on command line gradle cannot find resource file for dependent Module B. Line that throws exception: setParametersFromResource(context, R.raw.coursera_mobile_android, VALUE_NAMESPACE);

Patrol answered 15/2, 2016 at 19:27 Comment(2)
You might want to post your gradle files and the full error you are seeing.Halophyte
By the way, do you know there is a Gradle Console tool in Android Studio?Halophyte
P
1

I knew before you can read the gradle executions via the Gradle Console, but didn't realize you can execute that bundle of commands via command line.

Example from Gradle console:

Execute [:<module_name>:assembleDebug, :<module_name>:assembleDebugUnitTest]

to:

./gradlew [:<module_name>:assembleDebug, :<module_name>:assembleDebugUnitTest]
Patrol answered 16/2, 2016 at 19:36 Comment(1)
any better insight somewhere? I had understood that AS is running gradlew, so running gradlew should yield the same result but this does not seam to be the case. Running a single test method yields no output on the gradle console and I have a test that fails when run on AS but not on console.Fritillary

© 2022 - 2024 — McMap. All rights reserved.