android Set adb with screenrecord Screen Recording Command

  • 2021-10-25 07:49:31
  • OfStack

android Set the system/bin directory similar to linux. There are many utility commands in this directory, similar to

adb, sh, top, app_process, chmod, chown, dmesg, reboot, screenrecord and so on.

Screen recording function: Some bug needs to be restored to the scene during qa test. At this time, it is inconvenient to shoot with mobile phone. At this time, you can use the screen recording command to automatically complete screen recording, and then upload bug video.

Where the screenrecord command records video to internal storage:

Recording command:


adb shell screenrecord --size 1920x480 /storage/sdcard0/demorecord.mp4

Time Settings:


adb shell screenrecord --time-limit 100 /storage/sdcard0/demorecord.mp4

Stop recording:

Ctrl + C will stop the command and automatically stop recording.

Parameter settings:

$ adb shell screenrecord --help
Usage: screenrecord [options]
Records the device's display to a .mp4 file.
Options:
size WIDTHxHEIGHT sets the screen width and height, which is generally set according to your own mobile phone, and the maximum support is 1920x480.
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 bit Rate
Set the video bit rate, in megabits per second. Default 4Mbps.
time-limit TIME Set the recording time, and the default maximum duration is 180 seconds
Set the maximum recording time, in seconds. Default / maximum is 180.
rotate Rotary Output
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.

Summarize


Related articles: