iOS Virtual Path Campus Run Solution based on Xcode and Python Scripts
This solution generates standardized GPX path files via custom Python scripts, combined with Xcode developer tools to achieve mobile displacement simulation on iOS devices. It is suitable for campus run path testing and developer debugging.
🛠️ Environment Requirements
- iOS Device: iOS 26.0+
- Control Node: macOS 26.0+
- Development Tool: Xcode (Matching version)
- Environment Dependency: Python 3.x
🚀 Core Process
1. Generating Path File
Github Repository: See
GPXroute.pyin the Awesome-ZJU-Toolkit subfolder. You can quickly generate.gpxpath data conforming to track specifications using theGPXroute.pyscript. This script supports 400m/200m standard running track path picking.Get Coordinates: It is recommended to use Google Maps to obtain the precise start point latitude and longitude.
Run:
bashpython GPXroute.pyUsage: Input various indicators according to the prompt. The script will automatically export the
route.gpxpath file andpreview.htmlpreview file. Openpreview.htmlin the browser to view the path effect and fine-tune the initial latitude/longitude and deflection angle based on this.
2. Xcode Configuration
- Enable Developer Mode: On the iOS device, go to
Settings > Privacy & Security > Developer Modeand enable it; a device restart may be required. - Connect: Connect the iPhone to the Mac using a data cable. Ensure your iPhone is in the Connected state in Xcode
Window > Devices and Simulatorsunder Devices. - Import Path:
- Create a new iOS Xcode project.
- Drag the generated
.gpxfile into the Xcode project.
- Start Debugging:
- The first build requires writing a personal developer certificate, complete according to Xcode prompts.
- Click the Xcode Run button. After the app is deployed on the iPhone, return to Xcode, select the virtual coordinates in the console bar, and choose your imported
route.gpx. At this point, the phone's coordinates will start to change continuously according to the path file.
⚠️ Notes
IMPORTANT
- Coordinate Accuracy: Please ensure the input starting coordinates use the same map coordinate system as the campus running app to prevent deviation from the actual track.
- Compliance: This scheme is only for developer technical exchange and application path testing. Please abide by the relevant school and application usage codes.
🔗 References & Tools
Date 2026.04.06