標籤:adb adb-shell shell android 命令
Android ADB工具-和錄製視頻(五)
標籤(空格分隔): Android ADB
7. 和錄製視
| 命令 |
功能 |
| adb shell screencap –p <path/file> |
手機 |
| adb shell screenrecord [options] |
螢幕錄影 |
C:\Users\Administrator>adb shell screenrecord --helpUsage: 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\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
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
Android ADB工具-和錄製視頻(五)