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
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": {
"x": "<x>",
"y": "<y>"
},
"name": "tap"
}
}Input 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}`); } }