Skip to content

Instantly share code, notes, and snippets.

@fiskurgit
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fiskurgit/ed98b0bf83f2384a406a to your computer and use it in GitHub Desktop.
Save fiskurgit/ed98b0bf83f2384a406a to your computer and use it in GitHub Desktop.
Bash script to take a screenshot from an attached Android device, and resize (maintaining aspect ratio) to a width of 270 pixels (OSX only).
#!/bin/sh
timestamp=$(date +%s)
filepath=/sdcard/$timestamp.png
echo $filepath
adb shell screencap -p $filepath
adb pull $filepath
adb shell rm $filepath
sips --resampleWidth 270 $timestamp.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment