Skip to main content
Glama

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to type
udidNoSimulator UDID (optional, defaults to booted simulator)

Implementation Reference

  • 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,
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xmuweili/app-screen-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server