setLocation
Set device GPS location to specific coordinates for location testing.
Last updated
Set device GPS location to specific coordinates for location testing.
The setLocation command applies a mock geolocation to the device.
The following arguments are available for the setLocation command.
latitude
The latitude coordinate.
longitude
The longitude coordinate.
The following example sets the device's location to Amsterdam.
- setLocation:
latitude: 52.3599976
longitude: 4.8830301Keep the following limitations in mind when using setLocation:
On Android, this command requires API level 31 or higher.
The command only updates the device's coordinate-based location. When running tests in Maestro Cloud, services that rely on IP-based geolocation still resolve to a US-based IP address.
Last updated