Skip to content

Instantly share code, notes, and snippets.

@codeisafourletter
Forked from burntcookie90/adb_quick_screen.sh
Created January 31, 2018 00:55
Show Gist options
  • Save codeisafourletter/ccd37f3905b5526e0250483158fe7102 to your computer and use it in GitHub Desktop.
Save codeisafourletter/ccd37f3905b5526e0250483158fe7102 to your computer and use it in GitHub Desktop.
adb_quick_screen.sh
#!/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