Skip to content

Instantly share code, notes, and snippets.

@RussellCollins
Created December 2, 2015 08:56
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save RussellCollins/87e447183103fe6ca8b1 to your computer and use it in GitHub Desktop.
Save RussellCollins/87e447183103fe6ca8b1 to your computer and use it in GitHub Desktop.
Set write and read external storage permission prior to a test run so that a screenshot on fail listener can work on device targets running Android 6.0+
SDK=`adb shell getprop ro.build.version.sdk | tr -d '\r'`
echo "Device SDK level is: " $SDK
if (( "$SDK" >= 23 )) ; then
echo "Enabling read and write external storage permissions before running tests on Android 6.0+"
adb shell pm grant com.replace.with.your.app.package android.permission.WRITE_EXTERNAL_STORAGE
adb shell pm grant com.replace.with.your.app.package android.permission.READ_EXTERNAL_STORAGE
fi
@PjotrII
Copy link

PjotrII commented Apr 8, 2023

Mit is kell hozzá szólni?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment