GPX files for iOS Simulator [closed]

Where I can find GPX files that I can import into my iOS Simulator?

The iOS Simulator only contains static locations around the world and walk / bike / car drive simulations. This is not good enough for unit testing or other specific use cases.

This is the for GPX file: http://www.topografix.com/GPX/1/1/gpx.xsd

How can I simulate a movement along some custom route in Simulator or Xcode, cause it's needed in ios mobile development?


Solution 1:

  1. Run you app. In debug are you can find "Simulate location" button enter image description here

2.You can select one of default locations (here is list)

enter image description here

If you need a custom location

Create new file : File -> New ->File (Resources tab) GPX file click (at the bottom of locations list) "Add GPX File to workspace"

  1. Go to this website and get Latitude and Longitude of a Point that you need.
  2. Edit GPX file that you have created.
  3. Open "Simulate Location", the same as in step 1, and Your location from GPX file will be available in the list.The name of location will be same same as a name of the file.

Solution 2:

Here is a simple GPX file with an entry for Ann Arbor, Michigan. You can just change the name and lat/lon.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
version="1.1" 
creator="gpx-poi.com">

   <wpt lat="42.280826" lon="-83.743038">
      <name>Ann Arbor</name>
   </wpt>

</gpx>

Solution 3:

You create a route and generate a gpx file here - http://www.bikehike.co.uk/mapview.php

On another note it might help, are you aware the simulator can simulate movement if you run the simulator then select the following menu options:

  • Debug
  • Location
  • You can select freeway drive, cycle ride, run etc

Solution 4:

The following tool converts a Google Maps link (also works with Google Maps Directions) to a .gpx file.

https://mapstogpx.com/mobiledev.php

Simulating a trip duration is supported, custom durations may be specified. I enabled "Track Points" and Developer Settings > "Force Route as Waypoints" for a quick test, works flawlessly with Xcode 7.3.1.