使用gradle这个命令行参数到Android仪器测试 [英] command line arguments to Android instrument test using gradle
问题描述
有没有人有关于如何命令行参数传递到Android仪器测试运行使用gradle这个想法。调用带-p参数或-D参数gradle这个connectedInstrumentTest似乎并没有工作。我正在试图命令行参数传递给我的仪器测试的gradle使用
Does anyone has an idea about how to pass command line arguments to Android instrumentation tests run using gradle. Calling gradle connectedInstrumentTest with -p arguments or -D arguments did n't seem to work .I am trying to pass command line arguments to my instrument test using gradle.
推荐答案
这因为根据文档版本1.3.0插件是可能的:
http://tools.android.com/tech-docs/new-build-system
It is possible since 1.3.0 version of plugin according to docs: http://tools.android.com/tech-docs/new-build-system
这是现在可以在指定的仪器测试运行参数
的build.gradle(在defaultConfig或每味):
It's now possible to specify instrumentation test runner arguments in build.gradle (in defaultConfig or per flavor):
android {
defaultConfig {
testInstrumentationRunnerArguments size: "medium"
}
}
这也可以在命令行上进行:
This can also be done on the command line:
./ gradlew CC -Pandroid.testInstrumentationRunnerArguments.size =中等
./gradlew cC -Pandroid.testInstrumentationRunnerArguments.size=medium
这篇关于使用gradle这个命令行参数到Android仪器测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!