Simulate GPS location

GPS Geolocation testing enables you to simulate the location of the device to specific GPS coordinates in order to test location-based scenarios for your app.

Use the browserstack.gpsLocation capability to specify the GPS coordinates. You will be required to pass the latitude and longitude of the desired location.

Capability Description Value
browserstack.gpsLocation Simulate the location of the device to a specific GPS location. Latitude followed by longitude

Acceptable range for latitude is -90 to +90 and for longitude is -180 to +180.

Example: “40.730610,-73.935242”

Example:

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.gpsLocation", "40.730610,-73.935242");
var capabilities = {
	'browserstack.gpsLocation': '40.730610,-73.935242'
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserstack.gpsLocation", "40.730610,-73.935242");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.gpsLocation", "40.730610,-73.935242");
desired_cap = {
	'browserstack.gpsLocation': '40.730610,-73.935242'
}
desired_caps = {
    'browserstack.gpsLocation': '40.730610,-73.935242'
}
Note: GPS location feature for app testing is only available with a BrowserStack Paid plan. View details.