有没有人知道如何将命令行参数传递给使用 gradle 运行的 Android 仪器测试。使用 -p 参数或 -D 参数调用 gradle connectedInstrumentTest 似乎不起作用。我正在尝试使用 gradle 将命令行参数传递给我的仪器测试。
最佳答案
根据文档,从 1.3.0 版本的插件开始是可能的: http://tools.android.com/tech-docs/new-build-system
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=medium
关于android - 使用 gradle 进行 Android 仪器测试的命令行参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17797324/