Using GPX Files to Test Specific Locations

Testing location-based apps can be daunting, especially when specific locations need to be tested that are not convenient to test from. Fortunately, there is robust support for testing locations provided by Xcode using GPX files. A GPX file is a GPS Exchange Format document, which can be used to communicate GPS information between devices using XML. In debugging mode, Xcode can use a “waypoint” defined in a GPX file to set the current location for the iOS Simulator or device.

In the sample app, the current location is set with the file DMNS.gpx, or the location of the Denver Museum of Nature and Science.

<?xml version="1.0"?><gpx version="1.1" creator="Xcode">    <wpt

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.