Android 4.4 KitKat has introduced the possibility to record the screen of your device but not programmatically. The ability to record the screen of your device comes with an external tool added in ADB (Android Debug Bridge).

The ADB is a tool used by developers along with the Android SDK to communictate with a device at the command line level.

Record your screen on Android can be essential when you have created an application and you want make a video demo for Google Play Store for exeample.

To find the tool adb, you must go on the platform-tools/ directory that is at the root of your Android SDK installation directory.

Then, you can start to record your screen with following command line :


adb shell screenrecord /sdcard/demo.mp4

 

You can customize the speed at which it captures video, the length of time it records and the size of the video in terms of resolution.

Another example of command line to record a video with some options :


adb shell screenrecord --bit-rate 8000000 --time-limit 30 /sdcard/demo.mp4

 

Here, you will record at 8Mbps, instead of the default 4Mbps, for a duration of 30 seconds and save the result to the SD Card on your device with the name of demo.mp4 .