> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# press

> Press a physical device button.

Presses a physical device button. The simplified form takes the button name as a
single string.

## Parameters

| Parameter   | Type      | Required | Description                                                 |
| ----------- | --------- | -------- | ----------------------------------------------------------- |
| `key`       | `enum`    | Yes      | Button to press (see values below).                         |
| `longPress` | `boolean` | No       | Hold the button instead of a quick press.                   |
| `saveAs`    | `string`  | No       | Variable to store this step's return value on `env.<name>`. |
| `retries`   | `number`  | No       | Times to retry the step on failure before failing the test. |
| `skipped`   | `boolean` | No       | Skip this step at execution time.                           |

Button values: `home`, `power`, `back`, `app_switcher`, `search`, `volume_up`,
`volume_down`, `volume_mute`. `back`, `app_switcher`, `search`, and the volume
buttons are Android-only.

## Shorthand

Button name as a single string.

```yaml theme={null}
- press: home
```

## Examples

```yaml theme={null}
- press:
    key: back
    longPress: true # hold the button instead of a quick press
```

## Related

* [Test format](/core-concepts/test-format)
* [pressKey](/reference/mobile-commands/press-key)
