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
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.