3

I am trying to simulate the locations, using a gpx file.

The file does not work in the Xcode nor does it show any error.

The file size is 1.1 MB , has a tracking data from startPoint (A) to startPoint (B).

Does that cause any issues, any suggestion?

Ref: Add GPX File to Xcode 6 Project

Community
  • 1
  • 1
NNikN
  • 3,720
  • 6
  • 44
  • 86

3 Answers3

4

I noticed the same issue (Xcode 9.2). If you are adding the .gpx file through the status bar at the bottom and it's not appearing:

Drag and drop the .gpx file directly in your project navigator window on the left (where all your program files are)

and it should then appear in the drop-down simulator icon.

2

Found the actual reason is few tags of the content in the GPX file is not supported by XCode.

iOS does not support tags with tracking data.

<trk>
        <name>12</name>
        <trkseg>
            <trkpt lat="some value" lon="some value">
        </trkpt>
       <trkseg>
</trk>

So, get rid off all trk , trkseg tags. Now repleace trkpt with wpt.

That's it and you will be able to see simulation of your path.

Found the refernece at : http://deneymo.blogspot.com/2013/12/ios-customise-gps-path-for-simulator.html

A GPX file with only wpt points can be created here . http://gpx-poi.com

According to the following link https://developer.apple.com/library/content/documentation/IDEs/Conceptual/iOS_Simulator_Guide/CustomizingYourExperienceThroughXcodeSchemes/CustomizingYourExperienceThroughXcodeSchemes.html

Xcode and Simulator support specifying a route as a series of waypoints using the GPX <wpt> tag. The route (<rte>) and track (<trk>) tags are not supported.

NNikN
  • 3,720
  • 6
  • 44
  • 86
0

I have met this problem recently, and found that GPSBabel can convert track GPX file into waypoint format. Here is a sample command given in the document:

gpsbabel -i gpx -f blah.gpx -x transform,wpt=trk,del -o gpx -F converted.gpx

hzm
  • 420
  • 4
  • 9