tap
Simulate screen taps on Android devices by specifying X and Y coordinates for automated testing or remote control.
Instructions
Simulate a tap on the connected Android device at the specified coordinates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes |
Implementation Reference
- src/espresso_mcp/server.py:317-327 (handler)The main handler function for the 'tap' tool. It uses adb to simulate a tap gesture at given coordinates (x,y) on the connected Android device/emulator. Includes error handling and success message.@mcp.tool() def tap(x: int, y: int) -> str: """Simulate a tap on the connected Android device at the specified coordinates""" result = subprocess.run( ["adb", "shell", "input", "tap", str(x), str(y)], capture_output=True, text=True, ) if result.returncode != 0: raise RuntimeError(f"Error performing tap at ({x}, {y}): {result.stderr}") return f"Tap performed at coordinates ({x}, {y})."