input_text
Send text input to Android devices for automated testing, debugging, and development workflows. Type text into focused fields to simulate user interactions during app testing.
Instructions
Type text into the currently focused field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:498-504 (handler)Handler function for the 'input_text' tool. It escapes the input text for shell safety and executes an ADB shell input text command to type into the currently focused field on the Android device.@mcp.tool() def input_text(text: str, device_serial: str | None = None) -> str: """Type text into the currently focused field""" # Escape special characters for shell escaped = text.replace(" ", "%s").replace("&", "\\&").replace("<", "\\<").replace(">", "\\>") return run_adb(["shell", "input", "text", escaped], device_serial)