press_key
Sends Android key events such as back, home, enter, volume, and D-pad to a connected emulator or device via adb, with optional screen observation after the action.
Instructions
Press a key: back, home, enter, del, backspace, forward_del, tab, escape, app_switch, menu, search, power, wakeup, volume_up, volume_down, dpad_up, dpad_down, dpad_left, dpad_right, dpad_center, move_home, move_end, any KEYCODE_* name, or a key code number.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| serial | No | adb serial; optional when exactly one device is connected | |
| observe | No | What to return after the action: changes (default: only what changed since you last saw the screen, full tree on a new screen), ui (full tree), screenshot, both (tree + screenshot), none | changes |
| settle_ms | No | Wait before observing |