swipe
Simulate touch gestures on Android devices by swiping between specified coordinates for UI testing and automation.
Instructions
Swipe from start to end coordinates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_x | Yes | ||
| start_y | Yes | ||
| end_x | Yes | ||
| end_y | Yes | ||
| duration_ms | No | ||
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:444-460 (handler)The primary handler for the 'swipe' tool. Executes ADB shell input swipe command with provided coordinates and duration. Registered via @mcp.tool() decorator which handles schema from type hints.@mcp.tool() def swipe( start_x: int, start_y: int, end_x: int, end_y: int, duration_ms: int = 300, device_serial: str | None = None ) -> str: """Swipe from start to end coordinates""" return run_adb([ "shell", "input", "swipe", str(start_x), str(start_y), str(end_x), str(end_y), str(duration_ms) ], device_serial)