Skip to content

Instantly share code, notes, and snippets.

@MTen
Created July 23, 2015 19:44
Show Gist options
  • Save MTen/e5a5af911d855b8731d3 to your computer and use it in GitHub Desktop.
Save MTen/e5a5af911d855b8731d3 to your computer and use it in GitHub Desktop.
android screenshot from the command line
#Add this to your .bash_profile or .bash_alias and source ~/.bash_<<your location>>
#This uses the android debug bridge to screen cap.
#Usage: $ androidScreenshot <name of file>
#i.e. androidScreenshot myAwesomeScreenshot
androidScreenshot() {
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $1.png
echo "$1.png has been saved"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment