appium_geolocation
Manage device GPS location during mobile app tests by reading, setting, or resetting coordinates on iOS and Android.
Instructions
Get, set, or reset the device geolocation (GPS coordinates). Works on both iOS (simulators and real devices) and Android (emulators and real devices with mock location enabled). Use action=get to read current coordinates, action=set with latitude/longitude (and optional altitude for Android) to simulate a location, or action=reset to restore the system default. Note: On Android emulators, reset is not supported — use action=set to manually restore coordinates instead. On Android real devices, the mocked location may persist until the GPS cache refreshes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform. get: read the current device geolocation. set: set the device geolocation (requires latitude and longitude; optional altitude for Android). reset: reset the geolocation to the default/system value. Not supported on Android emulators — use action=set instead. | |
| altitude | No | Altitude value in meters. Android only, defaults to 0. Ignored on iOS. Used with: set. | |
| latitude | No | Latitude value (-90 to 90). Measurement of distance north or south of the Equator. Required for: set. | |
| longitude | No | Longitude value (-180 to 180). Measurement of distance east or west of the prime meridian. Required for: set. | |
| sessionId | No | Session ID to target. If omitted, uses the active session. |