您的位置:首页 > 运维架构 > Shell

Windows下通过Adb shell截屏Android UI并上传PC

2016-02-29 18:30 417 查看
#简单的Windows 环境下bat脚本发送ADB Commands 完成截图上传。

#Copy 该脚本保存为xx.bat,一般情况下双击执行,或使用管理员权限执行,保持ADB Connected。

@echo off
echo 截屏开始
echo adb devices
:: 切换到当前脚本目录并将文件导出该目录
%~d0 & cd %cd%

::adb devices >> Screencap_logs.txt

adb shell screencap -p /storage/sdcard0/pictures/Screenshots/NewScreenShot.png

::以PC系统时间命名截图
set PicName=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
adb pull /storage/sdcard0/pictures/Screenshots/NewScreenShot.png %PicName%.png
:: 清除上次样机测试截图
adb shell rm -f /storage/sdcard0/pictures/Screenshots/NewScreenShot.png
echo 截图已上传

:: pause
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: