zoukankan      html  css  js  c++  java
  • Android ADB工具-截图和录制视频(五)

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

    标签(空格分隔): Android ADB


    7. 截图和录制视

    命令 功能
    adb shell screencap –p <path/file> 手机截图
    adb shell screenrecord [options] 屏幕录像
    • 屏幕录像命名传入參数说明
    C:UsersAdministrator>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:UsersAdministrator>adb shell screencap -p /sdcard/screen.png
    >C:UsersAdministrator>adb pull /sdcard/screen.png C:UsersAdministratorDesktop
    >4841 KB/s (292531 bytes in 0.059s)

    屏幕录像

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

    C:UsersAdministrator>adb shell screenrecord /sdcard/s1.mp4

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

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

    录制320*480尺寸的视频

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

    C:UsersAdministrator>adb shell screenrecord --size 320*480 /mnt/sdcard/s2.mp4
    Invalid size '320*480', must be width x height
    
    C:UsersAdministrator>adb shell screenrecord --size 320x480 /mnt/sdcard/s2.mp4
    
  • 相关阅读:
    使用百度网盘配置私有Git服务
    Linked dylibs built for GC-only but object files built for retain/release for architecture x86_64
    我的博客搬家啦!!!
    今日头条核心业务(高级)开发工程师,直接推给部门经理,HC很多,感兴趣的可以一起聊聊。
    学习Python的三种境界
    拿到阿里,网易游戏,腾讯,smartx的offer的过程
    关于计算机网络一些问题的思考
    网易游戏面试经验(三)
    网易游戏面试经验(二)
    网易游戏面试经验(一)
  • 原文地址:https://www.cnblogs.com/mfmdaoyou/p/6912487.html
Copyright © 2011-2022 走看看