Issue
Im building a test suite for my app, but keep getting the following error when trying to run a test on an emulator:
$ 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
The real debug file i want the tests to run against is located at:
/Users/me/dev/Android/app/build/outputs/apk/debug/app-debug.apk
I have the following setup in 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'
}
Any idea how i can configure the test runner to look for the debug apk in the correct directory?
Thanks in advance :)
UPDATE - Things i have tried already are:
- ./gradlew connecteAndroidTest
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
- Creating a new test runner from Edit Configuration
Solution
After a lot of reading i determined it wasn't something that could be configured and something was funky with Android Studio, invalidating the caches and restarting fixed it :)
Answered By - davy307
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.