# RecorderCommands

Artifact: [androidx.test.uiautomator:uiautomator-shell](https://developer.android.com/jetpack/androidx/releases/test-uiautomator) [View Source](https://cs.android.com/search?q=file:androidx/test/shell/command/RecorderCommands.kt+class:androidx.test.shell.command.RecorderCommands) Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

*** ** * ** ***


```
public final class RecorderCommands
```

<br />

*** ** * ** ***

Allows running the screen record android utility to record the screen.

## Summary

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/test/shell/command/Recording` | `https://developer.android.com/reference/androidx/test/shell/command/RecorderCommands#start(java.io.File,kotlin.Int,kotlin.Int,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html outputFile, int width, int height, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int bitRateMb )` Starts the recording. |

## Public methods

### start

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
public final @NonNull Recording start(
    @NonNull File outputFile,
    int width,
    int height,
    @IntRange(from = 0) int bitRateMb
)
```

Starts the recording.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html outputFile` | the output file where to write the recording. |
| `int width` | the width of the screen in pixels. |
| `int height` | the height of the screen in pixels. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int bitRateMb` | the bitrate of the recording in Mb/s. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/test/shell/command/Recording` | a running `https://developer.android.com/reference/androidx/test/shell/command/Recording`. When `https://developer.android.com/reference/androidx/test/shell/command/RecorderCommands#start(java.io.File,kotlin.Int,kotlin.Int,kotlin.Int)`, and `https://developer.android.com/reference/androidx/test/shell/command/RecorderCommands#start(java.io.File,kotlin.Int,kotlin.Int,kotlin.Int)` are unspecified, the recorder uses the display's native resolution (if supported) and 1280x720\` when not. For more information, you can read the documentation [here](https://d.android.com/tools/adb#screenrecord). |