2

Xcode supports (supposedly) simulated locations by selecting a custom GPX file. When debugging, the debug terminal has a "Simulate Location" button which allows selection of standard locations as well as a custom. The standard locations all work fine. However, I cannot seem to select my own custom GPX file - they remain grayed out.

The GPX files I want to use show as "kind: gpx" in the finder file inspector and are known to have proper GPX formatted text (verified by import in other software). They are quite simple with just a single track, nothing complicated.

So, no idea why this doesn't work or what I am doing wrong. Some help is appreciated!

asked Jun 9, 2025 at 17:17
8
  • 1
    It isn't clear what you're doing. I don't know what you think the "debug terminal" is, and you have not specified at what point of the processes you are seeing files as "grayed out". I see at least three ways to add a GPX file to the project and they all work fine. It would help if you would be clearer about where exactly the issue lies; screenshots might help. Commented Jun 9, 2025 at 19:28
  • Debug Terminal/Area shown when one is debugging (shift-cmd-y if you like to bring it up). It has a "select location" button, which in turn has an "Add GPX To project" selection to customize which location is simulated. Selecting that option then lets one browse for a file to pick - any GPX file shown here is grayed out i.e. un-selectable. Commented Jun 9, 2025 at 21:02
  • OK but that's not the case on my machine. As I said, there are other ways to select that option, and on my machine all of them (including the one you mention) display gpx files as selectable, and you can indeed choose one and it is then added to the project, as advertised. Commented Jun 9, 2025 at 22:03
  • Rather than commenting on "there are other ways" why not share them, or at least 1 that works on your machine. Commented Jun 10, 2025 at 4:39
  • For instance the Scheme editor. Commented Jun 10, 2025 at 13:04

1 Answer 1

4

This may be relevant to the situation Yosht is in, it certainly was for me.

I experienced the same issue, with Xcode 16.4 unwilling to let me select any GPX file in any of the situations where you should be able to select those. Not in the Debug/Simulate Location/Add GPX Exchange to Project menu option, not in the Edit Scheme option. This was also true for any GPX file I created from within Xcode itself, using the iOS template for GPX files.

I created a new user and when logged in as that user, I created a new project. In that situation, Xcode would allow me to select a GPX file.

This lead me to believe that it has something to do with either the Spotlight feature, but rebuilding the database, even after removing all applications that have an interest in GPX files did not improve matters.

Then I inspected the LaunchService database. There is a tool, hidden away from view in:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister

that allows you to work with the LaunchService database. I dumped the database, using grep to look for clues:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep GPX

This revealed a left-over preference from a tool GPXViewer2 that I once tried but had removed some time ago. I decided to rebuild the database:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

This didn't take very long, maybe 10-20 seconds.

And behold, now Xcode suddenly recognizes these GPX files again.

HangarRash
16.7k5 gold badges31 silver badges64 bronze badges
answered Jul 15, 2025 at 16:49
Sign up to request clarification or add additional context in comments.

2 Comments

Worked like magic! Thanks!
@user3119631 Works! Thanks for taking the time to dig in - so much more helpful than "the other guy"

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.