keyboard
Type text or press named keys such as Enter, Escape, and arrow keys on iOS simulators, Android emulators, Chromium apps, and TV devices.
Instructions
Type text or press special keys on the device (iOS simulator, Android emulator, Chromium app, Vega Virtual Device, or Apple TV / Android TV) using keyboard events. Use when you need to enter text or trigger a named key such as enter, escape, or arrow keys. On Vega and Apple TV / Android TV, prefer the remote tools for D-pad navigation; use keyboard to type into a focused text field (e.g. a search or login box). Returns { typed: string, keys: number }. Fails if an unsupported key name is provided or the simulator-server / emulator backend / Chromium CDP / Vega adb / TV control daemons are not reachable for the given device.
text: types a string character by character (supports uppercase, digits, common punctuation)
key: presses a single named key (enter, escape, backspace, tab, arrow-up/down/left/right, f1–f12) — NOT supported on TV targets; move focus with
tv-remoteinstead. On a TV target (runtimeKind 'tv') onlytextapplies — focus a text field first (withtv-remote), then type into it (injected HID keyboard on Apple TV,adb input texton Android TV). Provide text, key, or both.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Named key to press: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1–f12. Not supported on TV targets — move focus with `tv-remote` (up/down/left/right) instead. | |
| text | No | Text to type character by character. Handles uppercase and common punctuation. | |
| udid | Yes | Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id). | |
| delayMs | No | Delay in ms between key presses (default 50). Ignored on Vega (text/keys injected in a single shot) and on TV targets (Apple TV / Android TV type the whole string at the daemon's own cadence). |