How to turn on console output in Android Unit tests?

android {


  testOptions {
        unitTests.all {
        // All the usual Gradle options.
            testLogging {
                events "passed", "skipped", "failed", "standardOut", "standardError"
                outputs.upToDateWhen {false}
                showStandardStreams = true

In my case, I followed this document and added the testLogging option as above. This should printout the log for the unit tests written under src/test folder but not the src/androidTest one. At the moment of this answer, I was using Android Studio 2.0 preview and gradle 2.8. The commands were ./gradlew test and ./gradlew test --continuein which ran in iTerm 2.

Leave a Comment