Skip to content

Instantly share code, notes, and snippets.

@qoopooh
Last active November 6, 2017 09:12
Show Gist options
  • Save qoopooh/927f9f6d821c3943a417d8e6b19a76ea to your computer and use it in GitHub Desktop.
Save qoopooh/927f9f6d821c3943a417d8e6b19a76ea to your computer and use it in GitHub Desktop.
Mac captures Android screen via adb
#! /bin/sh
#
# This is macos script that capturescreen of android devices
# and save the png file on current directory
#
# You can add argument to set file name
# ex. adb-screen pic # output is pic.png
#
if [ $# -eq 0 ]; then
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
else
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $1.png
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment