Skip to content

Instantly share code, notes, and snippets.

@rafaelje
Last active February 5, 2020 03:45
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 rafaelje/971dd863347490ecb3e1b2ebfd8d4097 to your computer and use it in GitHub Desktop.
Save rafaelje/971dd863347490ecb3e1b2ebfd8d4097 to your computer and use it in GitHub Desktop.
This script is for taking a screen shot of an Android device.
#! /bin/bash
## This script is for taking a screen shot of an Android device. MACOS - Linux
##
## Note the script generates screenshot_yyyyMMddHHmmss.png and screenshot_yyyyMMddHHmmss_s.png
## under /sdcard on the device and copies it to the current working directory.
## IMPORTANT RUN this command chmod 755 take.sh
##
file=screenshot_$(date "+%Y%m%d%H%M%S").png
dir=/sdcard
remote=${dir}/${file}
adb shell screencap -p ${remote}
adb pull ${remote}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment