Android command screencap view Help commands
[email protected] ~$ adb shell screencap -vscreencap: invalid option -- vusage: screencap [-hp] [-d display-id] [FILENAME] -h: this message -p: save the file as a png. -d: specify the display id to capture, default 0.If FILENAME ends with .png it will be saved as a png.If FILENAME is not given, the results will be printed to stdout.
Attention:
If the file name ends with a. png, it is saved as a PNG file
If the file name is not given, then the result will be output to stdout saved to SD card and exported
$ adb shell screencap -p /sdcard/screen.png$ adb pull /sdcard/screen.png$ adb shell rm /sdcard/screen.png
This method is more troublesome and requires 3 steps: 1. Save to SDcard 2. Export the picture 3. Delete pictures from SDcard save to PC
$ adb shell screencap -p | sed ‘s/\r$//‘ > screen.png
executing adb shell will \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ r \ n * * * *
In the future can be conveniently used And-screencap > directly will be saved to the computer
Ext.: http://blog.csdn.net/wirelessqa/article/details/22725581
Android Video recording command Screenrecord you need to know:
- Screenrecord is a shell command
- Support Android4.4 (API level 19) above
- Supported video formats: MP4
Some restrictions
- Some devices may not be able to record directly because the resolution is too high and if you encounter such a problem, try specifying a lower resolution
- Screen rotation during recording is not supported, if the recording process rotates, it is possible that the screen is cut off
- The sound won't be recorded when you record the video.
Start recording command:
adb shell screenrecord /sdcard/demo.mp4
Note: Recorded phone screen, video format mp4, stored in the phone SD card, the default recording time is 180s limit recording time:
Parameter:--time-limit
adb shell screenrecord --time-limit 10 /sdcard/demo.mp4
Description: Limit the video recording time to 10s, if not limited, the default 180s specifies the video resolution size:
Parameter:--size
adb shell screenrecord --size 1280*720 /sdcard/demo.mp4
Description: Recorded video, resolution 1280*720, if you do not specify the default use of the phone's resolution, for best results, use the Advanced video encoding (AVC) supported on the device to specify the bitrate of the video
Parameter:--bit-rate
adb shell screenrecord --bit-rate 6000000 /sdcard/demo.mp4
Description: Specifies that the video has a bit rate of 6Mbps, and if not specified, the default is 4Mbps. You can increase the bitrate to improve the video quality or to make the file smaller and lower the bit rate to display log at the command line
Parameter:--verbose
[email protected] wirelessqa$ adb shell screenrecord --time-limit 10 --verbose /sdcard/demo.mp4Main display is 1080x1920 @60.00fps (orientation=0)Configuring recorder for 1080x1920 video at 4.00MbpsContent area is 1080x1920 at offset x=0 y=0Time limit reachedEncoder stopping; recorded 96 frames in 10 secondsStopping encoder and muxerExecuting: /system/bin/am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/demo.mp4Broadcasting: Intent { act=android.intent.action.MEDIA_SCANNER_SCAN_FILE dat=file:///sdcard/demo.mp4 }Broadcast completed: result=0
Rotate 90 degrees
Parameter:--rotate
Description: This function is experimental, not good to know to view the help command
Parameter:--help
[email protected] ~$ adb shell screenrecord --helpUsage: screenrecord [options] <filename>Records the device‘s display to a .mp4 file.Options:--size WIDTHxHEIGHT 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 the video bit rate, in megabits per second. Default 4Mbps.--time-limit TIME Set the maximum recording time, in seconds. Default / maximum is 180.--rotate 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.
Export Video:
adb pull /sdcard/demo.mp4
Description: Export the video to the current directory
Android command screencap with video recording command Screenrecord