Skip to content

Instantly share code, notes, and snippets.

@markcerqueira
Created April 30, 2018 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markcerqueira/e4942b8dfd0afdf91038a26511cc4615 to your computer and use it in GitHub Desktop.
Save markcerqueira/e4942b8dfd0afdf91038a26511cc4615 to your computer and use it in GitHub Desktop.
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