博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android ADB工具-截图和录制视频(五)
阅读量:7092 次
发布时间:2019-06-28

本文共 1817 字,大约阅读时间需要 6 分钟。

Android ADB工具-截图和录制视频(五)

标签(空格分隔): Android ADB


7. 截图和录制视

命令 功能
adb shell screencap –p <path/file> 手机截图
adb shell screenrecord [options] 屏幕录像
  • 屏幕录像命名传入參数说明
C:\Users\Administrator>adb shell screenrecord --helpUsage: screenrecord [options] 
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 megabits per second. Default 4Mbps.--time-limit TIME 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.
  • –size WIDTH * HEIGHT : 输入的分辨率。默认是设备屏幕的显示分辨率
  • –bit-rate RATE: 设置视频比特率,默认是4mbps
  • –time-limit TIME: 设置视频的录时(单位:S),默认是180S
  • –rotate : 设置视频旋转90度
  • 终止录制: CTRL + C

手机截图

截图到手机sdcard

将screen.png复制到桌面s

>C:\Users\Administrator>adb shell screencap -p /sdcard/screen.png>C:\Users\Administrator>adb pull /sdcard/screen.png C:\Users\Administrator\Desktop>4841 KB/s (292531 bytes in 0.059s)

屏幕录像

此命令在Android4.4以上才干够使用

C:\Users\Administrator>adb shell screenrecord /sdcard/s1.mp4

输入此命令后命令会卡在页中,此时已经開始录像了,你能够滑动手机,操作

//開始屏幕录像C:\Users\Administrator>adb shell screenrecord /sdcard/s1.mp4^C//任意操作手机。。。//拷贝录像到电脑桌面查看C:\Users\Administrator>adb pull /sdcard/s1.mp4 C:\Users\Administrator\Desktop3394 KB/s (3531759 bytes in 1.016s)

录制320*480尺寸的视频

注意:尺寸使用英文字母x。不是*

C:\Users\Administrator>adb shell screenrecord --size 320*480 /mnt/sdcard/s2.mp4Invalid size '320*480', must be width x heightC:\Users\Administrator>adb shell screenrecord --size 320x480 /mnt/sdcard/s2.mp4

转载地址:http://lmnql.baihongyu.com/

你可能感兴趣的文章
leetCode 5 Longest Palindromic Substring
查看>>
学习笔记|AS入门(五) 高级控件篇(中)
查看>>
Android小知识-Retrofit框架的介绍以及使用方式
查看>>
设计模式(八)——策略模式
查看>>
Java多线程 -- 锁降级
查看>>
vux之x-input使用以及源码解读
查看>>
vue指令
查看>>
打死也不敢说自己火的面试题更新第二弹
查看>>
Android应用内悬浮窗,无需一切权限,适配所有ROM和厂商FloatWindow
查看>>
iOS逆向之旅(基础篇) — 汇编(三) — 汇编下的 Switch语句
查看>>
通俗易懂--决策树算法、随机森林算法讲解(算法+案例)
查看>>
1024程序员节最新福利之2018最全java资料集合
查看>>
《图解http》笔记
查看>>
ReactNative集成到原生项目
查看>>
为什么大部分编程语言的数组的下标都从0开始?
查看>>
react16.7.0-alpha hooks的api介绍
查看>>
『中级篇』 Linux网络命名空间(25)
查看>>
JS计算精度小记
查看>>
js的各种距离计算(较全)
查看>>
微信小程序异步API为Promise简化异步编程
查看>>