tap
Simulate precise taps on Android devices by specifying exact X and Y coordinates for testing or automation.
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, decorated with @mcp.tool() for registration. It executes an ADB command to simulate a tap gesture at given coordinates (x, y) on the connected Android device, with 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})."