Skip to main content

app_keyboard

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

The soft keyboard: whether it is up and which field has focus, typing at that field's cursor, pressing a named key, or hiding it. For the field nothing names — one that took focus by itself, the next field after enter — where app_type needs a target. Typing is confirmed by reading the field back, and retried on iOS, which drops keystrokes; a password field's value is never shown. A key is reported as sent, since what it does is the app's to decide. Hiding is confirmed; on an iPhone, whose keyboard has no hide key, it is refused when the app offers no way, with the one that usually works.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
hidebooleanHide the keyboard. Cannot be combined with text or key. Default false.
keystring: enter, delete, spacePress a named key, after any text.
textstringType this at the cursor of the field that has focus.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Type into the focused field and press Enter​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_keyboard",
"arguments": {
"text": "coffee",
"key": "enter"
}
}
}

On an Android 15 emulator the answer's text was:

typed "coffee" into username, which now holds coffee; the keyboard is hidden

mobium keyboard --text coffee --key enter on an Android 15 emulator

mobium keyboard --text coffee --key enter on an Android 15 emulator

Hide the keyboard​

{
"hide": true
}

On an Android 15 emulator the answer's text was:

hid the keyboard
BeforeAfter
Before: mobium keyboard --hide on an Android 15 emulatorAfter: mobium keyboard --hide on an Android 15 emulator

mobium keyboard --hide on an Android 15 emulator