1、首先我们了解截图和录屏最基础的命令
adb shell screenrecord sdcard/Record_xxx.mp4
adb pull sdcard/Record_xxx.mp4
adb shell screencap /sdcard/Screenshots_xxx.png
adb pull sdcard/Screenshots_xxx.png
2、实际开发中我们为了提高工作效率,采用脚本
- 录屏脚本 screenrecord.bat,root环境下调试使用
:: ITplus
:: V 1.0.0
@echo off
color 02
:: 保证手机非锁屏状态,锁屏状态录制不成功文件大小为0kb
:: 录制10s,可以手动修改
set recordtime=30
echo start screenrecord %recordtime% s
set filename=screenrecord%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
adb shell screenrecord sdcard/%filename%.mp4 --time-limit %recordtime% --bugreport
echo copy screenrecord %filename%.mp4
adb pull sdcard/%filename%.mp4
echo remove screenrecord %f