Fix script to make screenshots

This commit is contained in:
Emmanuel Engelhart 2018-01-17 13:53:35 +01:00
parent fca5d525a0
commit 1c59d54c9f

View File

@ -1,5 +1,19 @@
#!/bin/bash #!/bin/bash
../src/dependencies/android-sdk/platform-tools/adb shell screencap -p /sdcard/screenshot.png if hash adb 2>/dev/null
../src/dependencies/android-sdk/platform-tools/adb pull /sdcard/screenshot.png then
../src/dependencies/android-sdk/platform-tools/adb shell rm /sdcard/screenshot.png ADB=`which adb`
TMP=/data/local/tmp/
FILE=${1:-screenshot.png}
PATH=$TMP$FILE
$ADB shell screencap -p $PATH
$ADB pull $PATH
$ADB shell rm $PATH
echo "Screenshot saved to '$FILE'"
exit 0
else
echo "Unable to find 'adb'"
exit 1
fi