Set or clear a mock location
mobile_locationSets or clears GPS location on Android emulators and devices via ADB for location app testing; clear removes the injected test provider.
Instructions
On an emulator, set uses adb emu geo fix (longitude then latitude). Clearing an emulator fix fails because the console has no clear. On a device, set requires Android 12 (API 31) and injects a gps test provider via cmd location. Fused location clients can ignore that provider. clear removes it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | set | |
| serial | Yes | Exact ADB serial from mobile_devices_list; never inferred when multiple devices exist | |
| latitude | No | ||
| longitude | No | ||
| accuracyMeters | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backend | No | ||
| cleared | No | ||
| warning | No | ||
| latitude | No | ||
| longitude | No |