set_location
Set GPS coordinates on Android emulators for testing location-based features in development and QA workflows.
Instructions
Set GPS location (works on emulators)
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": {
"latitude": "<latitude>",
"longitude": "<longitude>"
},
"name": "set_location"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | ||
| longitude | Yes | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:1105-1114 (handler)The main handler function for the 'set_location' tool. It is decorated with @mcp.tool(), which likely handles both registration and schema definition via type hints. Executes ADB command to set GPS location on an Android emulator.
@mcp.tool() def set_location( latitude: float, longitude: float, device_serial: str | None = None ) -> str: """Set GPS location (works on emulators)""" return run_adb([ "emu", "geo", "fix", str(longitude), str(latitude) ], device_serial)