-
-
Save codeisafourletter/ccd37f3905b5526e0250483158fe7102 to your computer and use it in GitHub Desktop.
adb_quick_screen.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
binary=$(which adb) | |
filename=$HOME/screen_$(date +"%H%M%S").png | |
if [ -e $binary ] | |
then | |
adb shell screencap -p /sdcard/screen.png | |
adb pull /sdcard/screen.png $filename | |
adb shell rm /sdcard/screen.png | |
echo "Screenshot written to $filename" | |
else | |
echo "ADB isn't in your path!" | |
echo "Add it to your path with \$ export \$PATH:<path to adb>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment