press_key
Press a hardware or navigation key (enter, back, home, etc.) or raw keycode to trigger system actions like form submission, keyboard dismissal, or screen on/off. Optionally detect UI change.
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.
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). |