type_text
Type text into focused elements on iOS simulators for automated testing and interaction workflows.
Instructions
Type text into the currently focused element on the simulator
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "type_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to type | |
| udid | No | Simulator UDID (optional, defaults to booted simulator) |
Implementation Reference
- src/index.ts:788-799 (handler)The handler implementation for the `type_text` tool, which executes the `idb ui text` command.
private async typeText(text: string, udid?: string) { const target = await resolveUdid(udid); try { const safe = text.replace(/'/g, "'\\''"); await execAsync(`idb ui text --udid ${target} '${safe}'`); return { content: [{ type: 'text', text: `Typed "${text}" on ${target}` }], }; } catch (error: any) { throw new McpError(ErrorCode.InternalError, `Failed to type text: ${error.message}`); } } - src/index.ts:398-407 (registration)The tool definition and registration for `type_text` within the listTools handler.
name: 'type_text', description: 'Type text into the currently focused element on the simulator', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'Text to type' }, udid: { type: 'string', description: 'Simulator UDID (optional, defaults to booted simulator)' }, }, required: ['text'], additionalProperties: false, - src/index.ts:524-527 (handler)The tool execution switch case that maps the `type_text` tool to the class method.
case 'type_text': return this.typeText(args.text as string, args.udid); case 'swipe': return this.swipe(args.from_x, args.from_y, args.to_x, args.to_y, args.duration_ms, args.udid);