type_text
Enter text into Android device input fields using ADB automation to simulate keyboard input for testing or control purposes.
Instructions
Type text into the currently focused input field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to type | |
| device_id | No | Device ID (optional if only one device) |
Implementation Reference
- src/adb.ts:312-315 (handler)The actual implementation of the type_text logic using `input text` via adb.
async typeText(text: string, deviceId?: string): Promise<void> { const escaped = escapeShellText(text); await this.exec(["shell", "input", "text", escaped], deviceId); } - src/index.ts:291-302 (registration)MCP tool registration for "type_text" and the handler wrapper.
server.tool( "type_text", "Type text into the currently focused input field", { text: z.string().describe("Text to type"), device_id: z.string().optional().describe("Device ID (optional if only one device)"), }, async ({ text, device_id }) => { await adb.typeText(text, device_id); return { content: [{ type: "text", text: `Typed: "${text}"` }] }; }, );