fix(open): launch older Xcodes on newer macOS - #855
Open
savanne-kham wants to merge 1 commit into
Open
savanne-kham wants to merge 1 commit into
savanne-kham wants to merge 1 commit into
Conversation
NSWorkspace.openApplication routes through LaunchServices, which refuses to launch an Xcode built before the current macOS (e.g. Xcode 26 on macOS 27), showing an 'update to the latest version' dialog and making the Open button unusable for those versions. Launch the Xcode executable directly to bypass that compatibility gate. Before spawning, reuse an already-running instance of the same Xcode (matched by bundle URL) and activate it, so repeated clicks do not spawn duplicate processes. Rosetta launches are preserved via arch -x86_64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I updated to macOS 27 but still need Xcode 26.6 for an old project that doesn't build against the newer SDK. macOS blocks that version of Xcode when opened normally, so I had to launch its executable directly from Terminal:
Xcodes hit the same compatibility check because its Open action used NSWorkspace. This change directly launches an Xcode that predates the running macOS, while compatible versions continue to open normally through NSWorkspace. It also reuses and activates an existing instance, preserves Open in Rosetta, and adds a test for the version check.
This builds on the approach from #686.
Related: #784, #434.