From 353164e300c7faee02092a3f78a48d97ed9d7b37 Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Wed, 30 Oct 2013 18:26:00 -0700 Subject: [PATCH] docs: Add screenrecord command to adb docs Change-Id: I27d02d867aed46426e1bde5aa383f69e91bf7b15 --- docs/html/tools/help/adb.jd | 109 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd index 74f6c07f6b52..3002d6096840 100644 --- a/docs/html/tools/help/adb.jd +++ b/docs/html/tools/help/adb.jd @@ -20,6 +20,7 @@ page.tags="adb"
  • Using activity manager (am)
  • Using package manager (pm)
  • Examining sqlite3 databases from a remote shell
  • +
  • Recording a device screen
  • UI/Application Exerciser Monkey
  • Other shell commands
  • @@ -1106,7 +1107,11 @@ manage SQLite databases created by Android applications. The .schema to print the SQL CREATE statement for an existing table. The tool also gives you the ability to execute SQLite commands on the fly.

    -

    To use sqlite3, enter a remote shell on the emulator instance, as described above, then invoke the tool using the sqlite3 command. Optionally, when invoking sqlite3 you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder /data/data/<package_name>/databases/.

    +

    To use sqlite3, enter a remote shell on the emulator instance, as described above, +then invoke the tool using the sqlite3 command. Optionally, when invoking +sqlite3 you can specify the full path to the database you want to explore. +Emulator/device instances store SQLite3 databases in the folder +/data/data/<package_name>/databases/.

    Here's an example:

    @@ -1117,11 +1122,107 @@ Enter ".help" for instructions .... enter commands, then quit... sqlite> .exit -

    Once you've invoked sqlite3, you can issue sqlite3 commands in the shell. To exit and return to the adb remote shell, use exit or CTRL+D. +

    Once you've invoked sqlite3, you can issue sqlite3 commands in the +shell. To exit and return to the adb remote shell, use exit or CTRL+D. +

    Recording a device screen

    + +

    The {@code screenrecord} command is a shell utility for recording the display of a device as you + use it. The utility records screen activity to an MPEG-4 file, which you can then download and use + as part of a video presentation. This utility is useful for developers who want to create + promotional or training videos without using a separate recording device.

    + +

    To use the {@code screenrecord} from the command line, type the following: + +

    +$ adb shell screenrecord /sdcard/demo.mp4
    +
    + +

    Stop the screen recording by pressing Ctrl-C, otherwise the recording stops automatically +at three minutes or the time limit set by {@code --time-limit}.

    + +

    Here's an example recording session, using the adb shell to record the video and the +{@code pull} command to download the file from the device:

    + +

    +$ adb shell
    +shell@ $ screenrecord --verbose /sdcard/demo.mp4
    +(press Ctrl-C to stop)
    +shell@ $ exit
    +$ adb pull /sdcard/demo.mp4
    +
    + +

    The {@code screenrecord} utility can record at any supported resolution and bit rate you + request, while retaining the aspect ratio of the device display. The utility records at the native + display resolution and orientation by default, with a maximum length of three minutes.

    + +

    There are some known limitations of the {@code screenrecord} utility that you should be aware + of when using it:

    + + + + +

    Table 4. {@code screenrecord} options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionsDescription
    --help + Displays a usage summary.
    + --size <WIDTHxHEIGHT> + Sets the video size, for example: {@code 1280x720}. The default value is the device's main + display resolution (if supported), 1280x720 if not. For best results, use a size supported + by your device's Advanced Video Coding (AVC) encoder.
    --bit-rate <RATE>Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps. + You can increase the bit rate to improve video quality or lower it for smaller movie + files. The following example sets the recording bit rate to 6Mbps: +
    screenrecord --bit-rate 6000000 /sdcard/demo.mp4
    +
    --time-limit <TIME>Sets the maximum recording time, in seconds. The default and maximum value is 180 + (3 minutes).
    --rotateRotates the output 90 degrees. This feature is experimental.
    --verboseDisplays log information on command line screen. If you do not set this option, + the utility does not display any information while running.
    + +

    UI/Application Exerciser Monkey

    @@ -1151,9 +1252,9 @@ application and sends 500 pseudo-random events to it.

    Help is available for most of the commands.

    -

    Table 4 lists some of the more common adb shell commands.

    +

    Table 5 lists some of the more common adb shell commands.

    -

    Table 4. Some other adb shell commands

    +

    Table 5. Some other adb shell commands

    -- 2.11.0
    Shell Command