Repository navigation
Open Xcode by bundle ID rather than app name - #6160
Merged
Merged
Conversation
`open -a "XCode"` resolves via LaunchServices by application name, which fails when the only installed Xcode is `Xcode-beta.app` — a common setup for anyone on an iOS/macOS beta, who cannot install a stable Xcode for the current SDK alongside it. Both `Xcode.app` and `Xcode-beta.app` declare the bundle ID `com.apple.dt.Xcode`, so `open -b` locates either. It uses the same LaunchServices database as `-a`, keyed on bundle ID rather than name, so this keeps working for Xcode installed outside /Applications (Dart-Code#5420). Fixes Dart-Code#6159 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Member
|
Bot breakage is unrelated, there was an issue on master when this was branched that is since fixed. Thanks for the PR! |
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.
Fixes #6159
openInXcodecurrently launches Xcode by application name:open -aresolves via LaunchServices by app name, so this fails when the only installed Xcode isXcode-beta.app:Because the
safeToolSpawnresult isn't checked, nothing surfaces in the UI and the context-menu item appears to do nothing at all. This affects anyone working against an iOS/macOS beta, who generally can't install a stable Xcode for the current SDK alongside the beta.This switches to launching by bundle ID, which both
Xcode.appandXcode-beta.appdeclare:-buses the same LaunchServices database as-a, just keyed on bundle ID rather than name, so it should continue to work for Xcode installed outside/Applications(#5420). It also removes the reliance onopen -abeing case-insensitive for"XCode".The
.xcworkspace/.xcodeprojdiscovery above this line is unchanged — only the launch call differs.Testing: verified by patching the compiled
extension.jsin an installed 3.140.0 extension and restarting the editor; Open in Xcode then correctly opensRunner.xcworkspacein Xcode 27 beta. I haven't run the full extension test suite locally — happy to if you'd like, though there's no existing coverage foropenInXcode.