Created
June 27, 2016 10:04
-
-
Save quangson91/b1328fdc14aa487b1dcd3f57b8990dae to your computer and use it in GitHub Desktop.
Android capture screenshot with adb
This file contains 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
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 |
This file contains 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
# 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