For developers and QA

How to create a GPX file for iPhone location testing

Updated · By the Geovo team

A GPX file is plain XML: a list of points with a latitude, a longitude and, if you want, a time. Save the example below as route.gpx, change the coordinates, and play it on a real iPhone with Xcode or an app like Geovo.

What's in a GPX file?

GPX 1.1 has three kinds of points, defined in the GPX 1.1 schema:

  • Waypoints (wpt): single named places.
  • Routes (rte with rtept): an ordered list of stops to travel through.
  • Tracks (trk, trkseg, trkpt): a recorded path, often with a time on each point.

What does a simple one look like?

Save this as route.gpx:

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="me" xmlns="http://www.topografix.com/GPX/1/1">
  <metadata><name>Test route</name></metadata>
  <trk><name>Test route</name><trkseg>
    <trkpt lat="37.7955" lon="-122.3937"><time>2026-01-01T10:00:00Z</time></trkpt>
    <trkpt lat="37.7990" lon="-122.3972"><time>2026-01-01T10:05:00Z</time></trkpt>
    <trkpt lat="37.8024" lon="-122.4010"><time>2026-01-01T10:10:00Z</time></trkpt>
  </trkseg></trk>
</gpx>

What mistakes break a GPX file?

  • Swapped coordinates. GPX puts latitude and longitude in named attributes. KML is the opposite: longitude comes first.
  • A decimal comma. Write 37.7955, never 37,7955, whatever your computer's language is.
  • Times without a time zone. Use UTC with a trailing Z, as above.
  • Unescaped characters in names. Write &amp; for an ampersand.

How do you play it on an iPhone?

  • Xcode: add the file to your project, then pick it in Debug › Simulate Location while your app runs on a plugged-in iPhone. Xcode reads waypoints, and uses their times for the pace. More: simulate location with Xcode.
  • Geovo: import the GPX or KML file in the app on your Mac or PC and press play, at walking, cycling or driving speed. More: play a GPX file on iPhone.

Are there ready-made test routes?

Yes. We publish free GPX test routes on GitHub (MIT license): a walking loop, a geofence crossing with known entry and exit times, a straight drive, speed steps and a route with stops, each in Xcode's waypoint format and as a standard track, plus the script that makes them.

Frequently asked questions

What's the difference between a track and a route?
A route is a planned list of stops. A track is a recorded path, usually with many more points and a time on each.
Do GPX points need times?
No. Times are optional in GPX. Without them, the tool playing the file decides the speed.
Can I make a GPX file without coding?
Yes. It's a text file: any plain text editor works. Save it with the .gpx extension.

Try Geovo free for 15 minutes

Create a free account: no card, no password. Mac and Windows.