input_text
Enter text into active fields on Android devices during automation and testing. This tool simulates keyboard input to interact with apps and UI elements.
Instructions
Input text into the current field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to input |
Implementation Reference
- src/tools/handlers.ts:186-205 (handler)The handler function for the 'input_text' tool. It extracts the 'text' from args, escapes double quotes, executes ADB input text command, sends ENTER keyevent, captures UI dump, and returns confirmation with UI content.input_text: async (args: any) => { const { text } = args as { text: string }; const escapedText = text.replace(/"/g, '\\"'); await executeCommand(`adb shell input text "${escapedText}"`); await executeCommand(`adb shell input keyevent 66`); const uiContent = await captureUIContent(false); return { content: [ { type: 'text', text: `Text input: ${text}`, }, ...uiContent, ], }; },
- src/tools/definitions.ts:103-116 (schema)The tool definition including name, description, and input schema for 'input_text', which requires a 'text' string.{ name: 'input_text', description: 'Input text into the current field', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'Text to input', }, }, required: ['text'], }, },