ADB Concepts : How to Record ‘Android Screen’ with adb command

Get a step-by-step walkthrough in the video below!
Recording the Screen:
You can record the screen of an Android device using the adb shell screenrecord
command. This is a built-in tool in Android that allows you to capture the device screen directly via ADB (Android Debug Bridge). Here's how to do it:
Command:
adb shell screenrecord [options] <filename>
Example:
adb shell screenrecord - time-limit=30 - size 1280x720 /sdcard/Download/appiumguide.mp4
Optional Parameters
You can customize the recording using various flags:

--time-limit <seconds>
Limits the recording duration (max is 180 seconds).
Example:
adb shell screenrecord --time-limit 60 /sdcard/demo.mp4
--bit-rate <rate>
Sets video bit rate (default is 4Mbps).
Example:
adb shell screenrecord --bit-rate 8000000 /sdcard/demo.mp4
--size <width>x<height>
Sets video resolution.
Example:
adb shell screenrecord --size 1280x720 /sdcard/demo.mp4
--verbose
Displays log info while recording.
Pull the Video to Your Computer
After recording, you can transfer the video to your computer:
adb pull /sdcard/Download/appiumguide.mp4
To Stop Recording Manually
Use Ctrl + C
in the terminal (if not using --time-limit
).
GitHub Link:
No comments:
Post a Comment