Android ADB工具-截圖和錄制視頻(五)
標簽(空格分隔): Android ADB
7. 截圖和錄制視
命令 | 功能 |
---|---|
adb shell screencap –p <path/file> | 手機截圖 |
adb shell screenrecord [options] | 屏幕錄像 |
- 屏幕錄像命名傳入參數說明
C:\Users\Administrator>adb shell screenrecord --help
Usage: screenrecord [options] <filename>
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\Desktop
3394 KB/s (3531759 bytes in 1.016s)
錄制320*480尺寸的視頻
注意:尺寸使用英文字母x。不是*
C:\Users\Administrator>adb shell screenrecord --size 320*480 /mnt/sdcard/s2.mp4
Invalid size '320*480', must be width x height
C:\Users\Administrator>adb shell screenrecord --size 320x480 /mnt/sdcard/s2.mp4