Created
August 2, 2017 01:00
-
-
Save ctrl-freak/3844cc4be139b8760cd689501b95e3e2 to your computer and use it in GitHub Desktop.
Pull Screenshot from Android through ADB with DateTime Filename
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
@echo off | |
rem https://stackoverflow.com/questions/7727114/batch-command-date-and-time-in-file-name | |
rem %I if running in Command Prompt, %%I is for batch | |
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do @set datetime=%%I | |
set datetime=%datetime:~0,8%-%datetime:~8,6% | |
set filename=screen_%datetime%.png | |
rem https://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html | |
adb shell screencap -p /sdcard/%filename% | |
adb pull /sdcard/%filename% | |
adb shell rm /sdcard/%filename% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment