swipe
Simulate touch gestures on Android devices by swiping between specified coordinates for UI testing and automation.
Instructions
Swipe from start to end coordinates
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": {
"start_x": "<start_x>",
"start_y": "<start_y>",
"end_x": "<end_x>",
"end_y": "<end_y>"
},
"name": "swipe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_x | Yes | ||
| start_y | Yes | ||
| end_x | Yes | ||
| end_y | Yes | ||
| duration_ms | No | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
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)