Skip to content

Instantly share code, notes, and snippets.

@refo
Last active January 31, 2019 23:27
Show Gist options
  • Save refo/5498a49a5a025a0335ba to your computer and use it in GitHub Desktop.
Save refo/5498a49a5a025a0335ba to your computer and use it in GitHub Desktop.
Take an android screenshot to desktop
# OS X default screen shot date format
# e.g. "2015-08-28 at 18.45.05"
DATE=`date +"%F at %H.%M.%S"`
# OS X default screen shot file name
# e.g. "Screen Shot 2015-08-28 at 18.45.05.png"
FILE=~/Desktop/Screen\ Shot\ $DATE.png
# Path to genymotion adb
ADB="/usr/bin/env adb"
# Take the screen shot and save the output to user desktop
#$ADB shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > "${FILE}"
$ADB exec-out screencap -p > "${FILE}"
echo "${FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment