Is it possible to test against the release version

2019-04-24 11:29发布

问题:

When I use the 'gradlew connectedCheck' command it always build the debug version and test against the debug version of my app. Is it also possible to test against the release version of my app?

I want to enable proguard and want to make sure that it doesn't filter anything out that is needed during runtime.

回答1:

You can only test against a single build type right now (though that may change).

To set the build type to test against:

android {
    testBuildType "release"
}

You could set this dynamically through a env var to not have to edit build.gradle all the time.