Sometimes, your app needs more than just accessing the current location.
For example, you want to watch the location over time, whether to show it on the map or other features than make use of the location.
We can provide a current location for the simulator, however, we can't provide a lists of locations that showing the movement of the app over time with the default simulator settings.
Luckily for us, as developer, we are able to mock the locations of the app using
.gpx is a format to save GPS data. Basically it contains latitude, longitude and the timestamps at which the points are at.
.gpx file looks like this.
<gpx version="1.1" creator="gpxgenerator.com"> <wpt lat="3.109193" lon="101.461774"> <ele>7.00</ele> <time>2018-01-04T08:08:05Z</time> </wpt> <wpt lat="3.109562" lon="101.461968"> <ele>7.00</ele> <time>2018-01-04T08:08:20Z</time> </wpt> <wpt lat="3.109193" lon="101.461774"> <ele>6.96</ele> <time>2018-01-04T08:08:35Z</time> </wpt> </gpx>
When you have that file, add it to your xcode, and you will be able to use the coordinates in your simulator with a toggle.
So for my case, I am having 3 different paths I created for development and testing purpose. Each of them in its own
Select any one, and the simulator will pick up the location and changes over time.
Now you have different coordinates as time passes returned from the simulator to test.