How Android location works
What is mock location on Android, and how does it work?
Mock location is an Android developer feature that lets one selected app supply test locations instead of the real GPS fix. Apps that ask Android for location then receive the simulated position. It changes only what the location APIs report; your IP address and network don't change, and apps can see the location is marked as mock.
Loads from YouTube (youtube-nocookie.com) only when you press play.
Step by step: Turn on mock location on Android
- Enable Developer optionsOpen Settings › About phone and tap Build number seven times (the path varies by brand).
- Select a mock location appOpen Developer options › Select mock location app and choose the app that will provide test locations.
- Start a simulationStart a location or route in that app. Location-aware apps now receive the simulated position.
How location works on Android
Your phone works out where it is from several sources: GPS and other satellite systems, nearby Wi-Fi networks and cell towers. Google Play services combines them in the fused location provider, which is what most apps ask for.
What "mock" replaces
When you select a mock location app in Developer options, Android lets that app act as a test provider. While it's running a simulation, the position it supplies is what the location APIs hand to other apps — maps, weather, your own app under test — instead of the real fix.
The one-app rule
Only one app can be the mock location app at a time. Selecting another one replaces it, and choosing Nothing switches the feature off.
The mock flag: apps can see it
Every simulated location carries a flag. On Android 12 and later apps read it with Location.isMock(); earlier versions use isFromMockProvider(). Developers use it to treat test data differently in QA builds. It also means mock location is not a way to hide anything — and it isn't meant to be.
What mock location does not change
- Your IP address and the country it reveals
- Your mobile network and SIM country
- Location data already stored elsewhere, such as photo metadata
Legitimate uses
- Testing maps, geofences, delivery-radius logic and other location features
- Demos and screen recordings with a fixed, repeatable location
- Trip and route planning, such as previewing a route before you go
Turning it off
Stop the simulation in the app, then set Select mock location app to Nothing. Step by step: How to turn off mock location.
Frequently asked questions
Is mock location legal?
Yes. It's a built-in Android feature for developers and testers. Using it to deceive a service can break that service's terms, so use it for testing, development and personal use.
Does mock location need root?
No. It's part of Developer options on every Android phone; no root or special firmware is needed.
Does it change my IP address or country?
No. It changes only the location that Android's location APIs report. Your IP address, mobile network and SIM country stay the same.
Does mock location drain the battery?
A little, like any app running in the background. It only uses power while a simulation is running.
Can apps tell that a location is simulated?
Yes. Android marks each mock location: Location.isMock() on Android 12 and later, isFromMockProvider() on earlier versions. Apps can read that flag.
For testing, development and personal use. Please respect the terms of the services you use.