How do you capture video from the camera on command-line of a rooted Android mobile device?


Depending on the recording app installed, that could be done by calling the corresponding activity via the am (activity manager). The syntax for this is explained on the ADB help page:

start [options] <INTENT>

Example given:

am start -a android.intent.action.VIEW

This means, you first have to find the corresponding intent. This can be done using any Manifest browser (there are several apps available), or e.g. using the activity browser integrated with Apex Launcher (long-tap free space on homescreen, select Shortcut, then Activity). The am call then can either be initiated from within a terminal in the way described above, or via ADB by prefixing the call with adb shell, e.g. adb shell am start -a android.intent.action.VIEW.

See also: http://en.androidwiki.com/wiki/ADB_Shell_Command_Reference

  • 1
    Another way to get the activity is: launch the camera in video capture mode manually and then do adb shell dumpsys activity | grep mFocusedActivity to see the corresponding activity. Or do adb shell dumpsys activity recents | grep -A15 "Recent #0" (replace 'recents' with 'activities' for Android 4.2.1) and see the intent or activities responsible for video mode. – Firelord Aug 12 '15 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy