DISCLAIMER: This project is intended strictly for educational, research, and development purposes. The techniques and code provided are designed to help developers simulate GPS locations in controlled environments for legitimate testing, debugging, or demonstration purposes. Misuse of this technology — such as employing it to deceive, commit fraud, or violate any local, state, or federal laws — is strictly prohibited. Always ensure that you comply with all applicable terms of service and legal regulations when using this tool.
Spoof your iOS device's GPS location and simulate movement along routes using Xcode and Python.
- Mac with Xcode
- iOS device with Developer Mode enabled
- Google Maps API key (free tier sufficient)
- Python 3 with
gpxpyandpolylinelibraries
- Create a new iOS App project in Xcode (SwiftUI), keep all the default code
- Connect your iPhone via cable
- Enable Developer Mode on iPhone: Settings → Privacy & Security → Developer Mode → Enable → Restart
- Trust developer certificate: Settings → General → VPN & Device Management → Developer App
- Run the empty app on your device to verify setup
Install required libraries:
pip install gpxpy polyline- Get an API key from Google Maps Platform
- Copy the .env.example to .env and add your API key:
GOOGLE_MAPS_API_KEY=YOUR_API_KEY_HERE
-
Run the Python script and enter route details:
Enter the origin address: CN Tower, Toronto, Ontario Enter the destination address: CF Toronto Eaton Centre Enter the number of minutes to pause at the destination: 60 -
The script generates
route.gpxin the same directory. -
In Xcode, with your app running on the device:
- Go to Debug → Simulate Location → Add GPX File to Project
- Select your generated
route.gpxfile - Choose the custom route from the dropdown
-
Your iPhone will now follow the simulated route
- The iPhone must remain connected to Xcode and running the app for location spoofing to work
- You can use Apple's preset locations via Debug → Simulate Location without custom GPX files
- Update the
pathvariable in the Python script to specify GPX output location
This project was inspired by an article: https://medium.com/@kabirplanes/building-an-iphone-gps-spoofer-with-xcode-python-e849c10d634d