Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to build and run UI testing for Android using Spoon runner
# Uninstall existing APKs and install our app APK and test APK
./gradlew uninstallAll installDebug installDebugAndroidTest
# List all APKs installed with adb shell 'pm list packages -f'
# Grant the app APK write and read to external storage permissions
adb shell pm grant gg.mark.debug android.permission.WRITE_EXTERNAL_STORAGE
adb shell pm grant gg.mark.debug android.permission.READ_EXTERNAL_STORAGE
export APK=build/outputs/apk/debug/debug.apk
export TEST_APK=build/outputs/apk/androidTest/debug/debug-androidTest.apk
# TEST_APK and APK are positional arguments that need to be in the order specified here
# Disable GIF generation because it's slow
java -jar spoon-runner-2.0.0-20180425-all.jar --debug --disable-gif "$TEST_APK" "$APK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment