Skip to main content
Glama

ui_tap

Simulate screen taps on iOS Simulator by specifying coordinates and duration, enabling precise UI testing and interaction control.

Instructions

Tap on the screen in the iOS Simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationNoPress duration
udidNoUdid of target, can also be set with the IDB_UDID env var
xYesThe x-coordinate
yYesThe x-coordinate

Implementation Reference

  • The handler function that executes the 'idb ui tap' command to tap at specified coordinates on the iOS Simulator screen.
    async ({ duration, udid, x, y }) => { try { const actualUdid = await getBootedDeviceId(udid); const { stderr } = await idb( "ui", "tap", "--udid", actualUdid, ...(duration ? ["--duration", duration] : []), "--json", // When passing user-provided values to a command, it's crucial to use `--` // to separate the command's options from positional arguments. // This prevents the shell from misinterpreting the arguments as options. "--", String(x), String(y) ); if (stderr) throw new Error(stderr); return { isError: false, content: [{ type: "text", text: "Tapped successfully" }], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error tapping on the screen: ${toError(error).message}` ), }, ], }; } }
  • Zod input schema defining parameters: duration (optional), udid (optional), x and y coordinates (required).
    duration: z .string() .regex(/^\d+(\.\d+)?$/) .optional() .describe("Press duration"), udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), x: z.number().describe("The x-coordinate"), y: z.number().describe("The x-coordinate"), },
  • src/index.ts:270-328 (registration)
    Registration of the 'ui_tap' tool using server.tool(), conditionally filtered by isToolFiltered.
    if (!isToolFiltered("ui_tap")) { server.tool( "ui_tap", "Tap on the screen in the iOS Simulator", { duration: z .string() .regex(/^\d+(\.\d+)?$/) .optional() .describe("Press duration"), udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), x: z.number().describe("The x-coordinate"), y: z.number().describe("The x-coordinate"), }, async ({ duration, udid, x, y }) => { try { const actualUdid = await getBootedDeviceId(udid); const { stderr } = await idb( "ui", "tap", "--udid", actualUdid, ...(duration ? ["--duration", duration] : []), "--json", // When passing user-provided values to a command, it's crucial to use `--` // to separate the command's options from positional arguments. // This prevents the shell from misinterpreting the arguments as options. "--", String(x), String(y) ); if (stderr) throw new Error(stderr); return { isError: false, content: [{ type: "text", text: "Tapped successfully" }], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error tapping on the screen: ${toError(error).message}` ), }, ], }; } } ); }

Other Tools

Related Tools

  • @joshuayoes/ios-simulator-mcp
  • @cameroncooke/XcodeBuildMCP
  • @cameroncooke/XcodeBuildMCP
  • @vs4vijay/espresso-mcp
  • @cameroncooke/XcodeBuildMCP
  • @cameroncooke/XcodeBuildMCP

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/joshuayoes/ios-simulator-mcp'

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