作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的 Android 项目中有三种风格。我如何才能为我的仪器测试构建其中一个(“androidTest”构建 Artifact )?
当我使用 Android Studio 2.0 Beta 2 运行 gradle 任务 assembleAndroidTest
时,我得到三个输出 - 一个用于我的每一种口味:
myproject-dev-debug-androidTest-unaligned.apk
myproject-itest-debug-androidTest-unaligned.apk
myproject-production-debug-androidTest-unaligned.apk
如果我只想构建其中一个怎么办?我不想等待 3 倍的构建时间来构建我不需要的东西(是的,那太糟糕了)。
这是包含名称“androidTest”的所有 gradle 任务的列表:
assembleAndroidTest - Assembles all the Test applications.
compileDebugAndroidTestSources
compileDevDebugAndroidTestSources
compileItestDebugAndroidTestSources
compileProductionDebugAndroidTestSources
compileTelenorDebugAndroidTestSources
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
installDevDebugAndroidTest - Installs the android (on device) tests for the DevDebug build.
installItestDebugAndroidTest - Installs the android (on device) tests for the ItestDebug build.
installProductionDebugAndroidTest - Installs the android (on device) tests for the ProductionDebug build.
installTelenorDebugAndroidTest - Installs the android (on device) tests for the TelenorDebug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallDevDebugAndroidTest - Uninstalls the android (on device) tests for the DevDebug build.
uninstallItestDebugAndroidTest - Uninstalls the android (on device) tests for the ItestDebug build.
uninstallProductionDebugAndroidTest - Uninstalls the android (on device) tests for the ProductionDebug build.
uninstallTelenorDebugAndroidTest - Uninstalls the android (on device) tests for the TelenorDebug build.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
connectedDevDebugAndroidTest - Installs and runs the tests for devDebug on connected devices.
connectedItestDebugAndroidTest - Installs and runs the tests for itestDebug on connected devices.
connectedProductionDebugAndroidTest - Installs and runs the tests for productionDebug on connected devices.
connectedTelenorDebugAndroidTest - Installs and runs the tests for telenorDebug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
spoonDevDebugAndroidTest - Run all instrumentation tests on all connected devices for 'DevDebugAndroidTest'
spoonItestDebugAndroidTest - Run all instrumentation tests on all connected devices for 'ItestDebugAndroidTest'
spoonProductionDebugAndroidTest - Run all instrumentation tests on all connected devices for 'ProductionDebugAndroidTest'
spoonTelenorDebugAndroidTest - Run all instrumentation tests on all connected devices for 'TelenorDebugAndroidTest'
compileRetrolambdaDebugAndroidTest
compileRetrolambdaDevDebugAndroidTest
compileRetrolambdaItestDebugAndroidTest
compileRetrolambdaProductionDebugAndroidTest
compileRetrolambdaTelenorDebugAndroidTest
最佳答案
如果 flavor = "flavor"和 type = "debug",那么尝试:
./gradlew assembleFlavorDebugAndroidTest
关于android - 有没有办法只组装一种风格的 androidTest 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35334384/
我是一名优秀的程序员,十分优秀!