In this quick tip tutorial I am going to show you how to set the location of the iOS Simulator.
I get a few emails a month asking for this so I decided to write a quick tutorial.
Create Location Resource
In Xcode, go to File -> New -> File. Then from the side menu of the new dialogue that pops up, select Resource. Now you have some extra options, form these select GPX File
Click Next. You will then be asked to type in a name. I have called mine 10DowningStreet. Then save it.
Now, In your project navigation pane in Xcode, make sure you have your gpx file selected.
Edit everything in there so that it matches:
<?xml version="1.0"?> <gpx version="1.1" creator="Xcode"> <wpt lat="51.5034070" lon="-0.1275920"> <name>10 Downing Street</name> </wpt> </gpx>
Where ‘lat’ is the latitude and ‘lon’ is the longitude.
Set iPhone Simulator Location
This part is easy. Now, run whatever app you’re running. Go back to Xcode while the app is running and select the location icon near the console. You should now see 10DowningStreet in the dropdown list: