Experts in mobile automation claim that one of the functions in the operating system Android 4.4 KitKat is the built-in ability to record everything that is happening on the smartphone or tablet screen. This function is helpful during mobile application testing, as it allows to record software bugs.
Installation of the Software on the PC
A software testing company would recommend first of all installing Java development environment. To do this, one should go to Oracle website of and install JDK for the operating system: http://www.oracle.com/technetwork/java/javase/downloads/.
Then download Android SDK from the developer's site http://developer.android.com/sdk/.
It is necessary to unpack content of the downloaded archive in any suitable location. It is advisable to use an address without spaces (for example, C:\adt\).
Activation of USB Debugging on the Device:
1. Go to settings of the phone or tablet.
2. At the end of the list choose "About device".
3. Tap on the build number till the development mode activates.
4. Go to the section "Developer options" that have appeared.
5. Mark the checkbox "USB debugging":
6. Also, for clarity, one can enable the displaying of touches in the "Developer options":
7. Next, it is necessary to connect the phone or tablet PC.
8. Confirm in the dialog box on the device that we trust the PC:
9. Start the command prompt on the computer pressing Win+R, write "cmd" and press Enter.
10. Go to the directory "platform-tools", which is located in the section of Android Developer Tools, folder "sdk". In our case it will be the command “cd C:\adt\sdk\platform-tools”.
11. Check availability of Android devices by the command “adb devices”.
The answer should be something like:
12. Start recording on-screen video with the help of the command “adb shell screenrecord /sdcard/movie.mp4”, where "/sdcard/movie.mp4" is the path to the video and its name.
13. One can stop recording by the combination of Ctrl + C, or it will stop automatically in 180 seconds.
Those, who deal with mobile testing, know that it is possible to control quality of the recording, resolution and other video settings.
The Following Commands Allows to Customize Video Recording:
- size <WxH> (resolution, for example, 1280x720. By default, this parameter is equal to the resolution of the display device).
- bit-rate <flow rate>. Speed of the video stream in megabits per second. Default - 4 Mb / s. For example, to record video with the speed of 6 MB / s, one has to enter the following command: “screenrecord --bit-rate 6000000 /sdcard/demo.mp4”.
- time-limit <Time>. It specifies the maximum length of the video in seconds. The default is the maximum length - 180 seconds (3 minutes).
- rotate. It turns the video through 90 degrees. Experts in automated testing say that is currently experimental.
- verbose. It displays information about the recording process in the command prompt window.