Skip to content

Instantly share code, notes, and snippets.

@hdragomir
Last active August 29, 2015 14:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdragomir/11260446 to your computer and use it in GitHub Desktop.
Save hdragomir/11260446 to your computer and use it in GitHub Desktop.
droidshot - simple cli utility that wraps taking screenshots from an android phone
function droidshot {
saveto=~/droidshots
fname=$(date +"%Y%m%d%H%M").png
[[ ! -z $1 ]] && fname=$1
[[ -d $saveto ]] || mkdir $saveto
adb shell screencap -p /sdcard/$fname
adb pull /sdcard/$fname $saveto/$fname
adb shell rm /sdcard/$fname
echo "saved to $saveto/$fname"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment