fix(desktop): open Xcode by bundle id so version-suffixed installs launch
Fixes
What & why
"Open in Xcode" failed for developers who manage multiple Xcode versions (e.g. via Xcodes). Those installs have version-suffixed bundles like Xcode-16.2.app, whose display name is Xcode-16.2 — so the launcher's open -a "Xcode" (resolve-by-name) found nothing and failed.
Fix: launch Xcode by bundle id instead. Moved xcode from MACOS_APP_NAMES to BUNDLE_ID_CANDIDATES (com.apple.dt.Xcode), so getAppCommand emits open -b com.apple.dt.Xcode <path>, which resolves regardless of the .app display name. Mirrors the existing Zed / JetBrains multi-variant handling in the same file.
How I tested it
bun test apps/desktop/src/lib/trpc/routers/external/helpers.test.ts— updated the Xcode assertion to expect the bundle-id command; 113 pass.bun run lint,bun run typecheck— clean.- Manually tested (I use Xcode everyday)
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too) - "Allow edits from maintainers" is checked on fork PRs
Summary by cubic
Fixes "Open in Xcode" on macOS by launching via bundle id com.apple.dt.Xcode instead of app name, so version-suffixed installs like Xcode-16.2.app open correctly. Moves xcode from MACOS_APP_NAMES to BUNDLE_ID_CANDIDATES and updates the test to expect open -b.
Summary by CodeRabbit
- Bug Fixes
- Improved macOS Xcode launching by identifying the app through its bundle ID.
- Ensures compatibility with Xcode installations whose application names include version suffixes.