Created
February 7, 2013 02:24
-
-
Save narusemotoki/4727909 to your computer and use it in GitHub Desktop.
Androidのスクリーンショットを撮影してパソコンのホームディレクトリに保存するシェルスクリプト。
adbの用意が必要です。
スクリーンショットのファイル名はscreen_shot_{timestamp}.png。
Ubuntuで動作確認しています。Macは動くだろうけどWindowsは動かないと思う。
Cygwinなら動くのかな?
ICS以上じゃないと動かないかも。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TIMESTAMP=`date +'%s'`$(printf '%03d' $(expr `date +%N` / 1000000)) | |
SCREEN_SHOT_NAME=screen_shot_${TIMESTAMP}.png | |
adb shell /system/bin/screencap -p /sdcard/${SCREEN_SHOT_NAME} | |
adb pull /sdcard/${SCREEN_SHOT_NAME} ~/${SCREEN_SHOT_NAME} | |
adb shell rm /sdcard/${SCREEN_SHOT_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment