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:
It is possible since 1.3.0 version of plugin according to docs: 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
回答2:
you mean pass arguments to the am command? It's not possible at the moment.