mobile_double_tap_on_screen
Simulate a double-tap gesture at specific screen coordinates on mobile devices to trigger actions like opening apps, confirming selections, or activating UI elements during automated testing.
Instructions
Double-tap on the screen at given x,y coordinates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | The device identifier to use. Use mobile_list_available_devices to find which devices are available to you. | |
| x | Yes | The x coordinate to double-tap, in pixels | |
| y | Yes | The y coordinate to double-tap, in pixels |
Implementation Reference
- src/server.ts:356-370 (registration)Registration of the 'mobile_double_tap_on_screen' MCP tool, including input schema (device, x, y) and handler that calls doubleTap on the device-specific Robot instance.tool( "mobile_double_tap_on_screen", "Double Tap Screen", "Double-tap on the screen at given x,y coordinates.", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), x: z.number().describe("The x coordinate to double-tap, in pixels"), y: z.number().describe("The y coordinate to double-tap, in pixels"), }, async ({ device, x, y }) => { const robot = getRobotFromDevice(device); await robot!.doubleTap(x, y); return `Double-tapped on screen at coordinates: ${x}, ${y}`; } );
- src/server.ts:365-369 (handler)The tool handler function for mobile_double_tap_on_screen, which retrieves the Robot for the device and invokes its doubleTap method.async ({ device, x, y }) => { const robot = getRobotFromDevice(device); await robot!.doubleTap(x, y); return `Double-tapped on screen at coordinates: ${x}, ${y}`; }
- src/android.ts:446-450 (helper)AndroidRobot.doubleTap implementation: performs two taps at the coordinates with a 100ms delay between them.public async doubleTap(x: number, y: number): Promise<void> { await this.tap(x, y); await new Promise(r => setTimeout(r, 100)); // short delay await this.tap(x, y); }
- src/ios.ts:194-197 (helper)IosRobot.doubleTap implementation: delegates to WebDriverAgent (wda).doubleTap.public async doubleTap(x: number, y: number): Promise<void> { const wda = await this.wda(); await wda.doubleTap(x, y); }
- src/mobile-device.ts:184-188 (helper)MobileDevice.doubleTap implementation (for simulators): performs two sequential taps.public async doubleTap(x: number, y: number): Promise<void> { // TODO: should move into mobilecli itself as "io doubletap" await this.tap(x, y); await this.tap(x, y); }