Skip to content

Instantly share code, notes, and snippets.

@CameronBanga
Created May 12, 2016 16:14
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 CameronBanga/b1bdbe5de0750ef67c4499cd2d2963a1 to your computer and use it in GitHub Desktop.
Save CameronBanga/b1bdbe5de0750ef67c4499cd2d2963a1 to your computer and use it in GitHub Desktop.
Quickly take a screenshot of an Android phone plugged into your Mac/Linux box
#!/bin/bash
# need to install adb first, if you haven't
# brew install android-platform-tools
# then, save this script, chmod 750 it
# and easy get Android screens on your desktop
# note - this breaks when multiple Android devices
# are plugged into your computer
NOW=$(date +"%Y%m%d-%H%M%S")
FILE="android_screen_"$NOW
adb shell screencap -p /sdcard/$FILE.png
adb pull /sdcard/$FILE.png ~/Desktop
adb shell rm /sdcard/$FILE.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment