1. Take screenshots: screencap command
1. Use the screencap command to take screenshots and save them in the /sdcard/ directory
adb shell screencap /sdcard/screen.png
2. Copy the screenshot from the device to the host
adb pull /sdcard/screen.png local
2. Recording video: screenrecord
command (some mobile phones do not support)
1. Use the screenrecord command to record the device display and save the video in the /sdcard/ directory
adb shell screenrecord /sdcard/demo.mp4
2. Copy the video from the device to the host
adb pull /sdcard/demo.mp4 local
3. Screenrecord option
Options | Description |
---|---|
--help |
Show command syntax and options |
--size widthxheight |
Set the video 1280x720 size: . The default value is the native display resolution of the device (if supported); if not supported, it is 1280x720. For best results, please use the size supported by the device's Advanced Video Coding (AVC) encoder. |
--bit-rate rate |
Set the video bit rate of the video (in MB/sec). The default value is 4Mbps. You can increase the bit rate to improve the video quality, but doing so will cause the video file to become larger. The following example sets the recording bit rate to 6Mbps:
screenrecord --bit-rate 6000000 /sdcard/demo.mp4 |
--time-limit time |
Set the maximum recording duration (in seconds). The default and maximum values are both 180 (3 minutes). |
--rotate |
Rotate the output 90 degrees. This feature is in experimental stage. |
--verbose |
Display log information on the command line screen. If you do not set this option, the utility will not display any information when it runs. |