Created
February 18, 2025 11:46
-
-
Save Gizmodo/092b8f096624b676b85b5d45805111ab to your computer and use it in GitHub Desktop.
Take Android screenshot and write it to datetime filename
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 | |
set SCREENCAP_FILE_PREFIX=screenshot | |
set SCREENCAP_WORKING_DIR=/sdcard/ | |
set shortTime=%time:~0,8% | |
set shortTime=%shortTime: =0% | |
set SCREENCAP_FILE_NAME=screenshot_%date:-=%_%shortTime::=%.png | |
set SCREENCAP_FILE_PATH=%SCREENCAP_WORKING_DIR%%SCREENCAP_FILE_NAME% | |
adb shell screencap -p %SCREENCAP_FILE_PATH% | |
adb pull %SCREENCAP_FILE_PATH% | |
adb shell rm %SCREENCAP_FILE_PATH% | |
echo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment