How to increase time limit of ADB screen record of Android Kitkat

后端 未结 5 840
北海茫月
北海茫月 2020-12-15 09:31

I was using screen record functionality of ADB to record video of my application. It is very convenient and useful. Only issue I found is maximum time limit of 3 minutes (18

5条回答
  •  一整个雨季
    2020-12-15 10:14

    An alternative solution:

    adb shell "screenrecord --time-limit 5 /sdcard/testRun1.mp4; screenrecord --time-limit 5 /sdcard/testRun2.mp4"
    

    Notice the quotes and the semi-colon. The shell command is executed as a shell script on the Android device. The command above would create two mp4 files of 5 seconds each, one after the other.

    In our Jenkins test projects we do an exec step with a command like this:

    adb shell "screenrecord /sdcard/test1.mp4; screenrecord /sdcard/test2.mp4; screenrecord /sdcard/test3.mp4" & 
    

    The ampersand backgrounds the adb command to allow the rest of the test script to proceed. The command above will record up to 9 minutes.

提交回复
热议问题