adb shell截屏录屏命令

本文详细介绍使用ADB工具进行屏幕截图和录屏的方法。包括screencap与screenrecord指令的详细参数设置,如分辨率、比特率及保存路径等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、adb shell screencap 截屏指令

通过adb工具里的help 指令查看screncap指令的用法:

C:\Users>adb shell screencap -help
usage: screencap [-hp] [-d display-id] [FILENAME]
   -h: this message
   -p: save the file as a png.
   -d: specify the display id to capture, default 0.
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.

 将截屏保存到手机内存中再导入到电脑中:

adb shell screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png D:/1

二、adb shell screenrecord 录屏指令

首先通过help指令查看screenrecord指令的用法

C:\Users\>adb shell screenrecord --help
Usage: screenrecord [options] <filename>

Android screenrecord v1.2.  Records the device's display to a .mp4 file.

Options:
--size WIDTHxHEIGHT
    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
    Set the video bit rate, in bits per second.  Value may be specified as
    bits or megabits, e.g. '4000000' is equivalent to '4M'.  Default 4Mbps.
--bugreport
    Add additional information, such as a timestamp overlay, that is helpful
    in videos captured to illustrate bugs.
--time-limit TIME
    Set the maximum recording time, in seconds.  Default / maximum is 180.
--verbose
    Display interesting information on stdout.
--help
    Show this message.

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

录屏--time-limit

adb shell screenrecord --time-limit 200 /sdcard/record.mp4

若不指定则默认录屏时间为180s

adb shell screenrecord /sdcard/record.mp4

screenrecord命令支持Android4.4(API level 19)以上,支持的视频格式为mp4

录屏视频分辨率大小:--size

adb shell screenrecord --size 1280*720 /sdcard/record.mp4

默认是设备的主显示分辨率,否则为1280x720。

指定视频的比特率: --bit-rate

adb shell screenrecord --bit-rate 5000000 /sdcard/record.mp4

指定录屏视频比特率为5Mpbs,如果不指定则默认为4Mbps

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值