Note: This guide is written for Xcode 13.2.1, but the steps should be similar for other Xcode versions.
Download the spoofing project and route simulation file
Download and unzip the LocationMovement file.
Download the GPX file for route simulation if predefined Xcode Locations are not enough for the test
Download update_fake_route_here.gpx for movement simulation from MIT to Harvard.
You can create the position coordinate by your needs using online generators, i.e. https://gpxgenerator.com/
Install Xcode on your Mac
If you don’t have Xcode installed:
Login in with your Apple ID
Register your Apple developer ID
Note: There is no need to Enroll as you have to pay for it just register account and accept prompted “Registered Apple Developer Agreement”.
Download and install the latest XCode
Note: The spoofing project also works with the latest XCode version 13.2.1 - developer license will not be required to run the project
Log in to Xcode
XCode > Preferences > Account tab > add a new account > log in with your Apple ID
Set up the spoofing project in Xcode
Uncompress the zip file
Open the project in Xcode: File > Open > LocationMovement.xcodeproj
Add the route simulation file update_fake_route_here.gpx to the project (drag and drop) and delete the “red color - update_fake_route_here”
Configure the LocationSpoofing project
On XCode, Click on “LocationMovement” on the left side > Click on “General”
In the Identity section, make sure the Bundle Identifier is a unique string, as it’s necessary for signing certificate - add a suffix to the name (in the below example, the suffix is LocationMovement, but it can be anything)
In the Signing section, make sure your name is selected as the Team
Connect your iOS device to your Mac and select it as the build destination
Click the Play button in Xcode to start the build
‘Build succeeded’ message shown when complete (you might asked to allow access for codesign > Always allow)
If the developer profile is not trusted on the device, you will see an error message
Fix it on your iOS device (Settings > General > Device Management > Developer App > trust your developer profile > Trust)
You will need to click Play again after this
When build is successful, the LocationMovement app opens on your iOS device
Navigate to Apple Maps/Google Map > Your location should change on the map to Cambridge, Massachusetts, USA area
Run the simulation to different GPX file
Way 1: In Xcode, drag and drop your new GPX File > run the route simulation: Click Debug > Simulate Location > Click on added GPX File
Way 2:
Click on the “LocationMovement” on top mid bar of XCode > Click “Edit Scheme…”
On Pop up > Click “Run” > Click “Options” > Make sure “Allow Location Simulation” is ticked and on “Default Location”, select “update_fake_route_here” > click “Close”
Next Step: If you have a new GPX file, you can only click on “update_fake_route_here” and paste the new XML file from your downloaded GPX file & click “Play button” on the top bar (to create new build on your device) and voila, the location will simulate without needing to Click on Debug.
Understanding GPX File.
Dynamic Position
Dynamic position means that your position is not static in one spot. Thus, inside your GPX file, you will have a lot of <wpt></wpt> and inside wpt there will be time, the difference between wpt 1 and wpt 2 equals to your speed movement.
Static Position
On Static position, you will have only 1 <wpt></wpt> because you are staying at the same position.
#TestlioBot