Whether it's teaching or demonstrating, it's really cool if you can record your Android phone (or tablet) 's screen as a video file (IOS8 has already provided the ability to record ipad, iphone screens directly on your Mac via OSX, which Windows hasn't tried, I don't know if I can). But the previous method was recorded by the screenshot, the effect is very poor. Fortunately Android4.4 the above version provides this feature. However, it cannot be started directly on the phone and needs to be started by ADB using the command line.
Everyone can enter the shell. Or simply execute the order directly with Adbshell. The command is Screenrecord, you can enter Screenrecord--help to see the help, as shown below.
Usage:screenrecord [Options] <filename>
Android Screenrecord v1.2. Records The device ' s display to a. mp4 file.
Options:
--size Widthxheight
Set the videosize, e.g. "1280x720". Defaultis the device ' s main
DisplayResolution (if supported), 1280x720 if not. For best results,
Use a sizesupported by the AVC encoder.
--bit-rate Rate
Set thevideo bit rate, in bits per second. Value may specified as
Bits ormegabits, e.g. ' 4000000 ' is equivalent to ' 4M '. Default 4Mbps.
--bugreport
Addadditional information, such as a timestamp overlay, that's helpful
In videoscaptured to illustrate bugs.
--time-limit time
Set Themaximum recording time, in seconds. Default/maximum is 180.
--verbose
Displayinteresting information on stdout.
--help
Show Thismessage.
Recording continues until ctrl-c is hits or the TimeLimit is reached.
From these help information you can see that Screenrecord needs to follow a MP4 file name. The simplest form is as follows:
Screenrecord/sdcard/game.mp4
Note, however, that the directory to be written by the MP4 must be writable.
After entering the command, press ENTER directly, the command will be blocked, the default is nothing output, this is recording it. All images of the mobile phone will be recorded. If you want to output the appropriate information, you need to add--verbose command line arguments, add the command line arguments, the entire recording process may output the following similar information.
Main display is 1080x1920 @60.00fps (orientation=0)
Configuring Recorder for 1080x1920 VIDEO/AVC at4.00mbps
Content area was 1080x1920 at offset x=0 y=0
^cencoder stopping; Recorded frames in seconds
Stopping encoder and Muxer
Executing:/system/bin/am broadcast-aandroid.intent.action.media_scanner_scan_file-d file:///sdcard/test.mp4
broadcasting:intent {act=android.intent.action.media_scanner_scan_file Dat=file:///sdcard/test.mp4}
Broadcast completed:result=0
Of course, there are many options, commonly used is--size (size) 、--bit-rate (bit rate) and--time-limit (recording maximum time)
The default size is the current phone screen resolution, bit rate is the default 4Mbps, recording time by default is 3 minutes (180 seconds)
Screenrecord--time-limit 100/sdcard/game.mp4
The above command can record a maximum of 100 seconds of video. If you want to stop recording halfway, you can press CTRL C to stop the recording, and the Game.mp4 will still be generated, but only the video will be recorded from the start recording to the time you press CTRL-C. It's a 20-second shooting game I recorded. The full video can be downloaded at the address below.
Recording Video Downloads
How the Android System records the screen (recorded in MP4 format)