For web developers and QA
How to test website geolocation on a real iPhone
Updated · By the Geovo team
To test a website's geolocation on a real iPhone, serve the page over HTTPS, allow location for Safari, then change the iPhone's GPS location and reload or watch the page update. Safari's Geolocation API (navigator.geolocation) reads the same location iOS gives apps, so a location you simulate with Geovo from a Mac or Windows PC, or from the Geovo iPhone app, is what your page receives. Desktop browser overrides don't reach Safari on the phone, so this is how you check store finders, delivery-area checks and maps on the real device.
Why desktop overrides aren't enough
Desktop browser tools can fake a position for a page open on your computer (Chrome DevTools has a Sensors panel for this). That's useful for logic, but it doesn't test the thing your users actually run: Safari on an iPhone, with iOS's permission prompts, Precise Location, the page going to the background when the user switches apps, and real touch layouts around a map. To test that, the iPhone itself has to report the location you want.
Safari's Geolocation API gets its position from iOS Location Services. When Geovo sets the iPhone's GPS location, Safari, other browsers on the iPhone and web views inside apps all read that location, like any app does. Nothing changes on your server and nothing needs to be added to the page.
Step by step
- Serve the page over HTTPS. Browsers only expose geolocation in a secure context. A staging URL with a valid certificate works; so does an HTTPS tunnel to your local dev server. Opening `http://192.168.x.x:3000` from the iPhone won't work, even though `localhost` works on your computer.
- Check iOS permissions. In Settings › Privacy & Security › Location Services, Location Services must be on and Safari Websites must not be Never. Safari also keeps a per-site choice (Ask, Deny or Allow) under the page menu's Website Settings.
- Set the location. Download Geovo, plug in the iPhone (tap Trust, turn on Developer Mode) and teleport by tapping the map or searching. Save the places you test often as favorites.
- Request it fresh. Call `getCurrentPosition` with `maximumAge: 0` while testing. With a large `maximumAge` the browser may hand back a cached position from before you teleported, which looks like "the location didn't change".
- Test movement. Use `watchPosition` and play a walking or driving route in Geovo (or import a GPX or KML file, see routes explained). Check how your page handles a stream of updates: map re-centering, distance calculations, throttling.
- Return to your real location in Geovo when you're done.
| Case | How to set it up | What your page should do |
|---|---|---|
| Location allowed | Allow the Safari prompt; teleport to a test city | Show results for that city (store finder, delivery area, map) |
| Permission denied | Tap Don't Allow, or set the site to Deny | Handle error code 1 (PERMISSION_DENIED) with a manual address or postcode field |
| Approximate location | Turn off Precise Location for Safari Websites | Work with a larger accuracy radius; don't pretend to know the street |
| Slow or no fix | Use a short timeout in your own test build | Handle code 3 (TIMEOUT) and code 2 (POSITION_UNAVAILABLE) without a blank screen |
| Moving user | Play a route with watchPosition running | Update smoothly and stop watching when the user leaves the page |
| Region edge | Teleport just inside and just outside a service area | Switch between in-area and out-of-area states correctly |
Debugging on the device
- Web Inspector (Mac). On the iPhone, turn on Settings › Safari › Advanced › Web Inspector, connect it to a Mac, and the page appears in Safari's Develop menu on the Mac. You can watch the console and network while Geovo moves the location (WebKit: enabling Web Inspector).
- Windows. Safari's Web Inspector needs a Mac, but you can still drive the location from Geovo for Windows and log positions to the page itself (for example, print `coords.latitude`, `coords.longitude` and `coords.accuracy` in a small debug panel).
- Other browsers on the iPhone. Each browser app has its own entry in Location Services, so allow location for the one you're testing.
- Web views in your own app. A page inside an app's web view asks for location through that app, so the app needs its own location permission. Geovo's location applies there too, which helps when you test a hybrid app.
What a simulated GPS location doesn't change
Geovo changes the GPS position only. It doesn't change the iPhone's IP address, time zone or language. If your site picks a region from the visitor's IP (currency, a country redirect, a cookie banner variant), that still follows the real network, so test it with your backend's own overrides or a staging flag. This split is useful: you can check that your page prefers the browser's location when the user shares it, and falls back sensibly when they don't.
Also remember that apps can ask iOS whether a location was simulated by software (CLLocationSourceInformation); web pages don't get that signal, but native parts of a hybrid app can.
Make it repeatable for your team
- Favorites for each test city or service-area edge, so every tester uses the same points.
- GPX export of a route you drew, committed next to your tests, to replay the same path every run.
- Session track export to attach exactly what the iPhone was told to a bug report.
- On the iPhone itself: testers can install the Geovo iPhone app and change location with nothing plugged in, on Wi-Fi or cellular (how it works).
Coordinates never leave your devices. Free for 30 minutes every day with every feature, after a 10-minute try without an account. Pro is unlimited: $5.99/week, $11.99/month, $24.99 for 3 months, $69.99/year ($5.83/month) or $99.99 once for lifetime. Pro works on 2 computers and 2 iPhones. See pricing.
Use it responsibly
Geovo is for lawful use only: testing apps and websites, keeping your exact position private from an app that doesn't need it, demos, travel planning and teaching how location services work. Don't use any location tool to mislead people who rely on your location, or to break the terms of an app or service you've agreed to. Stop simulating whenever your real location matters, for example in an emergency.
Frequently asked questions
- How do I change the location Safari sees on my iPhone?
- Change the iPhone's GPS location. Safari's Geolocation API reads iOS Location Services, so a location set with Geovo from a Mac, a Windows PC or the Geovo iPhone app is what websites receive after you allow location.
- Why does navigator.geolocation not work on my iPhone?
- The usual causes are a page served over plain http, Location Services off, Safari Websites set to Never in Location Services, or the site set to Deny in Safari's Website Settings.
- Why does my page still show the old location after I teleport?
- The browser may be returning a cached position. Request it again with maximumAge set to 0, or use watchPosition to get updates as the location changes.
- Can I override geolocation in Safari's Web Inspector instead?
- Web Inspector is the right tool for watching the console and network on the iPhone. To change the position the iPhone reports, set the device location itself with a tool like Geovo.
- Does Geovo change the IP address websites see?
- No. Geovo changes GPS only. Anything your site bases on the visitor's IP address still sees the real network.
- Do I need a Mac?
- No. Geovo runs on Mac and Windows 10/11, and its iPhone app changes the location with nothing plugged in. Safari's Web Inspector is the only part that needs a Mac.
Try Geovo free
30 minutes every day, every feature. Mac and Windows.