Last active
January 15, 2016 21:30
-
-
Save fiskurgit/32c6a729174fffe5abfc to your computer and use it in GitHub Desktop.
Pass image resize width argument to the Android screenshot.sh script: screenshot.sh 480 open
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 | |
width=$1 | |
openInPreview=$2 | |
timestamp=$(date +%s) | |
filepath=/sdcard/$timestamp.png | |
echo $filepath | |
adb shell screencap -p $filepath | |
adb pull $filepath | |
adb shell rm $filepath | |
sips --resampleWidth $width $timestamp.png | |
if [ "$openInPreview" = "open" ] ; then | |
open $timestamp.png | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment