批处理+adb命令实现Android截图小工具

使用方法:复制代码保存为.bat结尾的文件,修改截图的保存路径,无线连接版需要修改为自己手机的ip地址。

wifi无线连接版本:

echo 开始截图...
taskkill /IM adb.exe -f
adb tcpip 5555
adb connect 192.168.80.25:5555
adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png D:Pictures
call mspaint.exe D:Picturesscreenshot.png
echo 截图完成...
pause

数据线版本:

adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png D:Pictures
call mspaint.exe D:Picturesscreenshot.png

 根据时间戳命名图片名称的版本:

@echo off
echo 开始截图...
taskkill /IM adb.exe -f
adb tcpip 5555
adb connect 192.168.80.25:5555
adb shell screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png D:Picturesscreenshot.png
set d=%date:~0,10%
set filename=%date:~0,10%_%time:~0,2%-%time:~3,2%-%time:~6,2%.png
set filename=%filename:/=-%
echo %filename%
ren D:Picturesscreenshot.png %filename%
call mspaint.exe D:Pictures%filename%
echo 截图完成...
pause

原文地址:https://www.cnblogs.com/xiamaojjie/p/13972165.html