Skip to content

Instantly share code, notes, and snippets.

@Adam--
Last active May 31, 2024 07:15
Show Gist options
  • Save Adam--/19dbfb7e8c49c2292caece25a58e6f17 to your computer and use it in GitHub Desktop.
Save Adam--/19dbfb7e8c49c2292caece25a58e6f17 to your computer and use it in GitHub Desktop.
Take an Android screenshot using ADB on Windows
adb devices
adb shell screencap -p /sdcard/screen.png
adb pull -p -a /sdcard/screen.png
adb shell rm /sdcard/screen.png
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-3 delims=/:" %%a in ("%TIME%") do (set mytime=%%a-%%b-%%c)
set mytime=%mytime: =%
ren screen.png Screenshot_%mydate%_%mytime%.png
start Screenshot_%mydate%_%mytime%.png
@adislice
Copy link

adislice commented May 9, 2018

Edit this line if you get syntax error :
ren screen.png Screenshot_%mydate%_%mytime%.png
change to :
ren screen.png "Screenshot_%mydate%_%mytime%.png"

@lumotroph
Copy link

This is fantastic and working on windows 10 in 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment