tap
Tap at specific coordinates on iOS Simulator screens to automate testing and interaction tasks for mobile applications.
Instructions
Tap at specific (x, y) coordinates on the simulator screen
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X coordinate in points | |
| y | Yes | Y coordinate in points | |
| udid | No | Simulator UDID (optional, defaults to booted simulator) |
Implementation Reference
- src/index.ts:749-759 (handler)Implementation of the 'tap' tool handler that uses the 'idb' CLI to execute a tap at specific coordinates.
private async tap(x: number, y: number, udid?: string) { const target = await resolveUdid(udid); try { await execAsync(`idb ui tap --udid ${target} ${x} ${y}`); return { content: [{ type: 'text', text: `Tapped (${x}, ${y}) on ${target}` }], }; } catch (error: any) { throw new McpError(ErrorCode.InternalError, `Failed to tap: ${error.message}`); } }