Skip to content

Instantly share code, notes, and snippets.

@quangson91
Created June 27, 2016 10:04
Show Gist options
  • Save quangson91/b1328fdc14aa487b1dcd3f57b8990dae to your computer and use it in GitHub Desktop.
Save quangson91/b1328fdc14aa487b1dcd3f57b8990dae to your computer and use it in GitHub Desktop.
Android capture screenshot with adb
PREFIX="android_screenshot"
if [ $# -gt 0 ]
then
PREFIX=$1
fi
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/${PREFIX}_$(date +'%Y-%m-%d_%H-%M-%S').png
# Capture screenshot with default PREFIX.
./android_screencapture.sh
# Capture screenshot with custom PREFIX.
./android_screencapture.sh home_screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment