Skip to content

Instantly share code, notes, and snippets.

@serverwentdown
Created March 14, 2015 15:07
Show Gist options
  • Save serverwentdown/e274825576997aecaa6b to your computer and use it in GitHub Desktop.
Save serverwentdown/e274825576997aecaa6b to your computer and use it in GitHub Desktop.
adbscreenshot
#!/bin/sh
adb shell "screencap -p /storage/sdcard1/tmp.png"
if [ "$1" == "-" ]; then
adb pull /storage/sdcard1/tmp.png /dev/stdout
elif [ "$1" == "" ]; then
adb pull /storage/sdcard1/tmp.png /dev/stdout | open -f -a /Applications/Preview.app
else
adb pull /storage/sdcard1/tmp.png "$1"
fi
adb shell "rm /storage/sdcard1/tmp.png"
@SungMatt
Copy link

What is this supposed to do? View the contents of an I/O device that is not properly named?

@serverwentdown
Copy link
Author

does a screenshot over ADB and opens it in Preview.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment