Last active
December 14, 2015 14:19
-
-
Save mattak/5099636 to your computer and use it in GitHub Desktop.
android easy screen capture
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
#!/bin/sh | |
# | |
# Android easy screen capture. | |
# | |
# usage: | |
# ashot | |
# ashot shot1.png | |
# | |
# args for adb | |
if [ $# -eq 2 ]; then | |
ADB="adb -s $1" | |
else | |
ADB="adb" | |
fi | |
shift | |
# args for savepath | |
SAVE_PATH=screenshot.png | |
if [ $# -eq 1 ]; then | |
SAVE_PATH=$1 | |
fi | |
IMG_PATH=/sdcard/tmp.png | |
$ADB shell screencap -p $IMG_PATH | |
$ADB pull $IMG_PATH $SAVE_PATH | |
$ADB shell rm $IMG_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment