Skip to content

Instantly share code, notes, and snippets.

@Adam--
Created April 8, 2016 14:08
Show Gist options
  • Save Adam--/81dbac3fc044471819f0addb73c6954a to your computer and use it in GitHub Desktop.
Save Adam--/81dbac3fc044471819f0addb73c6954a to your computer and use it in GitHub Desktop.
Windows batch files for useful Android ADB commands. Replace [device] with your device as listed from "adb devices" or remove the -s [device] entirely.
adb -s [device] shell input keyevent 4
adb -s [device] shell input keyevent 3
adb -s [device] shell screencap -p /sdcard/screen.png
adb -s [device] pull -p -a /sdcard/screen.png
adb -s [device] 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: =%
move screen.png _Screenshots/Screenshot_%mydate%_%mytime%.png
start _Screenshots/Screenshot_%mydate%_%mytime%.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment