press_key
Press Android hardware or navigation keys by name or keycode to submit forms, dismiss keyboards, navigate back, and control power or volume. Verify UI changes to detect silently consumed presses.
Instructions
Press a hardware/navigation key by name (enter, back, home, menu, tab, del, escape, up, down, left, right, dpad_center, app_switch, search, power, wakeup, sleep, volume_up, volume_down, ...) or a raw Android keycode number. Handy to submit a form (enter), dismiss the keyboard (escape), or go back (back). To turn the screen ON use wakeup (not power, which toggles and may sleep an awake screen); sleep turns it off. A key can be silently consumed with no effect (e.g. back while a biometric prompt is up) — pass verify_change=true to get ui_changed: true/false instead of guessing. Batching several presses (or a press whose timing matters relative to other actions) belongs in run_sequence, not in separate calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name (enter, back, home, menu, tab, del, escape, up, down, left, right, ...) or a raw keycode number. | |
| serial | No | Target device serial (adb -s). Optional when exactly one device is attached. | |
| verify_change | No | Also report whether the UI hierarchy changed after the key press (ui_changed: true/false). Costs two extra hierarchy reads (~2-3s); use when the key may be silently consumed (e.g. back while a biometric prompt is up). |