Android 知识点 251 —— screenrecord 录屏

本文详细介绍了Android系统中screenrecord命令的使用方法,包括录制视频到内部存储、设置录制时间限制、停止录制等操作,以及如何通过adb shell执行screenrecord命令进行录屏,适用于QA测试过程中的bug复现。

android 设置system/bin目录类似linux,该目录下有许多实用命令,类似adb,sh,top,app_process,chmod,chown,dmesg,reboot,screenrecord等等。
录屏作用:qa测试过程中有的bug需要还原现场,此时用手机拍摄有诸多不便,此时可以利用录屏命令自动完成录屏,然后上传bug视频。

其中screenrecord命令录制视频到内部存储:
录制命令:
adb shell screenrecord --size 1920x480 /storage/sdcard0/demorecord.mp4
时间设置:
adb shell screenrecord --time-limit 100 /storage/sdcard0/demorecord.mp4

停止录制:
Ctrl + C会停止命令,自动停止录制。

参数设置:
$ adb shell screenrecord --help
Usage: screenrecord [options]
Records the device’s display to a .mp4 file.

Options:
–size WIDTHxHEIGHT 设置屏幕宽高,一般根据自己手机设置,最大支持1920x480。
Set the video size, e.g. “1280x720”. Default is the device’s main
display resolution (if supported), 1280x720 if not. For best results,
use a size supported by the AVC encoder.
–bit-rate RATE 设置bit率
Set the video bit rate, in megabits per second. Default 4Mbps.
–time-limit TIME 设置录制时间,默认最大时长180秒
Set the maximum recording time, in seconds. Default / maximum is 180.
–rotate 旋转输出
Rotate the output 90 degrees.
–verbose
Display interesting information on stdout.
–help
Show this message.

Recording continues until Ctrl-C is hit or the time limit is reached.
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ricardo于

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值