[英]Android Gradle task: connectedInstrumentTest for Release Build?
有没有办法针对Release构建类型或任何其他自定义构建变体运行测试?
connectedInstrumentTest任务的默认行为是仅针对Debug构建变体运行测试
有任何想法吗?
AFAIK connectedInstrumentTest
针对使用testBuildType
属性指定的构建类型运行。 您可以尝试从命令行参数中进行动态读取:
android {
testBuildType obtainTestBuildType()
}
def obtainTestBuildType() {
def result = "debug";
if (project.hasProperty("testBuildType")) {
result = project.getProperties().get("testBuildType")
}
result
}
然后用它来调用它
./gradlew connectedInstrumentTest -PtestBuildType=release
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.