Android ADB工具-截圖和錄製視頻(五)

來源:互聯網
上載者:User

標籤: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工具-和錄製視頻(五)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.