adb连接Android设备使用screenrecord命令录屏和screencap命令截屏

1、adb连接Android设备使用screenrecord命令录屏

PS C:\Users\user> adb shell

root@rk322x_box:/ # screenrecord --help    //查看screenrecord命令帮助
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        //时间;默认最大180秒
    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.

root@rk322x_box:/ # screenrecord --size 1920x1080 --bit-rate 8000000 --time-limit 10 /mnt/media_rw/3622-C659/test203.mp4        //录制视频

root@rk322x_box:/ # exit        //退出Android shell
PS C:\Users\user\Desktop>

PS C:\Users\user\Desktop> adb pull /mnt/media_rw/3622-C659/test203.mp4    //把视频文件拉取到电脑桌面
/mnt/media_rw/3622-C659/test203.mp4: 1 file pulled, 0 skipped. 1.9 MB/s (436351 bytes in 0.219s)

2、adb连接Android设备使用screencap命令截屏

root@rk322x_box:/ # screencap -h    //查看命令帮助
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.

root@rk322x_box:/ # exit
PS C:\Users\user\Desktop>

PS C:\Users\user\Desktop> adb shell screencap -p /mnt/media_rw/3622-C659/test101.png    //截屏命令

PS C:\Users\user\Desktop> adb pull /mnt/media_rw/3622-C659/test101.png    //把截图文件拉取到电脑桌面
/mnt/media_rw/3622-C659/test101.png: 1 file pulled, 0 skipped. 2.1 MB/s (671530 bytes in 0.298s)
PS C:\Users\user\Desktop> ls | findstr test        //查看文件是否拉取成功
-a----         2021/3/17     16:46         671530 test101.png
-a----         2021/3/17     16:49         436351 test203.mp4

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值