Created
September 29, 2022 12:45
-
-
Save fellypsantos/c0bd3108e3f1ce2e4e87745f2a4eb445 to your computer and use it in GitHub Desktop.
Take a screenshot from phone connected over adb, and save it to desktop.
This file contains 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
@echo off | |
REM Screenshots will be saved to save directory | |
REM where your script is running. | |
REM Generate filename as timestamp | |
set FILENAME=%DATE:/=-%@%TIME::=-% | |
set FILENAME=%FILENAME: =% | |
set FILENAME=%FILENAME:,=.%.png | |
REM Capture a screenshot and save to /sdcard/screen.png on your Android device. | |
adb shell screencap -p /sdcard/screen.png | |
REM Grab the screenshot from /sdcard/screen.png to /tmp/screen.png on your PC. | |
adb pull /sdcard/screen.png ./%FILENAME% | |
REM Delete /sdcard/screen.png | |
adb shell rm /sdcard/screen.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment