setLocation
Set the device GPS location to specific coordinates for location testing.
Partial support in Astra Scout
Android devices and emulators, and iOS Simulators, are supported. On a real iPhone the command fails because Apple provides no way to override GPS on a physical device.
The setLocation command applies a mock geolocation to the device.
Arguments
The following arguments are available for the setLocation command.
| Argument | Description |
|---|---|
latitude | The latitude coordinate. |
longitude | The longitude coordinate. |
Usage examples
The following example sets the device's location to Amsterdam.
yaml
- setLocation:
latitude: 52.3599976
longitude: 4.8830301Limitations
Keep the following limitations in mind when using setLocation:
- On Android, this command requires API level
31or higher. - The command only updates the device's coordinate-based location. Services that rely on IP-based geolocation are not affected.
