If you have worked on these features, you would know that just manually running around the map is basically insufficient for testing, such as:
- Food delivery range
- City-switching content
- Nearby people/stores
- Region restriction policies
Especially when multiple cities and various boundary conditions are involved, testing costs increase rapidly.
So in actual development, I usually directly modify the device’s positioning data to verify logic.
Why I Don’t Simply Change Location on the Phone
Many people’s first reaction is to use the phone’s location settings to change it?
But in reality:
- iOS does not allow arbitrary modification of GPS
- The simulator is not equivalent to a real device
- App behavior differs significantly between real devices and simulators
So if you need to verify real-world performance, you have to operate on a real device.
Common Methods
Method 1: Xcode Simulated Location
Suitable for the development phase:
- Can set GPX paths
- Can simulate movement trajectories
But there are several issues:
- Requires a Mac
- Not convenient for testers
- Not suitable for quickly switching between multiple cities
Method 2: Third-Party Virtual Positioning Apps
Some apps can modify location, but with many limitations:
- Unstable compatibility
- Easily detected by apps
- Operation is not intuitive
A More Stable Method Used in Practice
In project testing, I more commonly use device tools to directly modify GPS.
I use Keymob Developer Assistant
Actual Operation Steps (Can Follow Directly)
1 Connect the Device
- Connect iPhone via USB
- Open Keymob Developer Assistant
Once the device is recognized, you will see the device information screen.
2 Enter Common Operations
On the device information page, you can see an area:
Common Operations
This includes:
- Restart device
- Rename
- Virtual location
- Screenshot
3 Open Virtual Location
Click on Virtual Location
4 Input Latitude and Longitude
Here is a key point: use accurate latitude and longitude.
You can obtain coordinates via map tools, for example:
- Baidu Maps / Google Maps
- Right-click to copy coordinates

For example:
Shanghai: 31.2304, 121.4737
Beijing: 39.9042, 116.4074
5 Confirm the Modification
After input, click confirm.
6 Verify if It Took Effect
Method 1: Open the Map App
- Check current location
- See if it has changed
Method 2: Open the Target App
- See if content has changed
- E.g., city, recommended content
Advanced: Combine with Logs to Observe Behavior
Sometimes just looking at the UI is not enough.
For example:
- Why didn’t the content change?
- Did it request the wrong API?
Use Real-Time Logs
I also open real-time logs simultaneously.
Observe:
- Network request URLs
- Location information in parameters
This confirms whether the app actually uses the new GPS.
Even More Advanced: Use with Performance Testing
In some scenarios, location changes affect performance:
- Map loading
- Data request volume
- Image resources
At this point, you can combine with performance charts (CPU / Memory)
Switch locations while observing changes.