With Android version 4.4 (KitKat) one can record Android device\'s screen with following command using ADB from commandline.
adb shell screenrecord /
To avoid time limit issue, you can use this snippet:
./adb exec-out "while true; do screenrecord --bit-rate=16m --output-format=h264 --size 720x1280 --time-limit 180 -; done" | ffplay -framerate 60 -framedrop -bufsize 16M -