Espresso 找不到测试 apk
Espresso not finding test apk
我正在为我的应用程序构建一个测试套件,但在尝试 运行 在模拟器上进行测试时不断收到以下错误:
$ adb push /Users/me/dev/Android/app/build/outputs/apk/debug/app-debug.apk /data/local/tmp/myApp.debug
$ adb shell pm install -t -r "/data/local/tmp/myApp.debug"
pkg: /data/local/tmp/myApp.debug
Success
The APK file /Users/me/dev/Android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk does not exist on disk.
Error while Installing APK
我想要运行测试的真正调试文件位于:
/Users/me/dev/Android/app/build/outputs/apk/debug/app-debug.apk
我在 gradle 中有以下设置:
android.defaultConfig {
testInstrumentationRunner
'android.support.test.runner.AndroidJUnitRunner'
}
...
dependencies {
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'
// Espresso support
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// add this for intent mocking support
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'
}
知道如何配置测试 运行ner 以在正确的目录中查找调试 apk 吗?
提前致谢:)
更新 -
我已经尝试过的事情是:
- ./gradlew connecteAndroidTest
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
- 正在从编辑配置创建新测试运行ner
经过大量阅读,我确定它不是可以配置的东西,Android Studio 中有些东西很时髦,使缓存无效并重新启动修复了它:)
我正在为我的应用程序构建一个测试套件,但在尝试 运行 在模拟器上进行测试时不断收到以下错误:
$ adb push /Users/me/dev/Android/app/build/outputs/apk/debug/app-debug.apk /data/local/tmp/myApp.debug
$ adb shell pm install -t -r "/data/local/tmp/myApp.debug" pkg: /data/local/tmp/myApp.debug Success
The APK file /Users/me/dev/Android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk does not exist on disk. Error while Installing APK
我想要运行测试的真正调试文件位于:
/Users/me/dev/Android/app/build/outputs/apk/debug/app-debug.apk
我在 gradle 中有以下设置:
android.defaultConfig {
testInstrumentationRunner
'android.support.test.runner.AndroidJUnitRunner'
}
...
dependencies {
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'
// Espresso support
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// add this for intent mocking support
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'
}
知道如何配置测试 运行ner 以在正确的目录中查找调试 apk 吗?
提前致谢:)
更新 - 我已经尝试过的事情是:
- ./gradlew connecteAndroidTest
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
- 正在从编辑配置创建新测试运行ner
经过大量阅读,我确定它不是可以配置的东西,Android Studio 中有些东西很时髦,使缓存无效并重新启动修复了它:)