input_text
Type text into focused input fields on Android devices through the Android MCP Server, enabling automated text entry for UI automation tasks.
Instructions
Type text into the currently focused input field on the Android device. The field must already be focused (tapped).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to type into the focused field | |
| device_id | No | Device serial number |
Implementation Reference
- src/adb/input-controller.ts:133-143 (handler)Implementation of the input_text tool handler which uses adb shell to send text input.
export async function inputText(text: string, deviceId?: string): Promise<string> { const resolved = await deviceManager.resolveDeviceId(deviceId); deviceManager.checkRateLimit(resolved); const sanitized = sanitizeTextInput(text); await adbShell(['input', 'text', sanitized], resolved); deviceManager.touchSession(resolved); log.info('Text input performed', { textLength: text.length, deviceId: resolved }); return text; }