[BUG] iOS Simulator pane misreports "Xcode not selected" when /var/db/xcode_select_link is absent (auto-discovery fallback not checked)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Attaching to the iOS Simulator fails with error code idb_not_installed and the message "Xcode is installed but not selected. Run sudo xcode-select -s ...". However, xcode-select -p, xcodebuild, and xcrun simctl all work correctly from the shell — Xcode selection is not actually broken.
What Should Happen?
The availability check should follow the same resolution order xcode-select itself uses: (1) the DEVELOPER_DIR env var, (2) the /var/db/xcode_select_link symlink, (3) fallback auto-discovery of an installed Xcode.app. Claude Code Desktop currently only checks step (2) — the symlink — and misclassifies any environment where that symlink was never created (i.e. xcode-select -s was never run, relying purely on the OS's own auto-discovery) as "Xcode not selected".
Steps to Reproduce
- Install Xcode and never run
xcode-select -s(so/var/db/xcode_select_linkdoes not exist; the system relies purely on auto-discovery) - Confirm
xcode-select -preturns a valid path (proving auto-discovery works) - In Claude Code Desktop, attach to the iOS Simulator
- Observe the
idb_not_installederror with the "Xcode is installed but not selected" message - Confirm
ls /var/db/xcode_select_link→No such file or directory
Error Messages/Logs
[Simulator] attach failed (idb_not_installed): Xcode is installed but not selected. Run `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` to use the Claude Code iOS Simulator.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.24012.1 (0adcae)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other (Claude Code Desktop app)
Additional Information
- macOS version: 26.5.2 (Build 25F84)
- Xcode version: 26.6
- Workaround:
sudo ln -sfn "$(xcode-select -p)" /var/db/xcode_select_linkresolves the issue immediately — this simply recreates the symlink thatxcode-select -swould normally create as a side effect. idb/idb_companionare not an external dependency — they're fully bundled asFBControlCore.framework/FBSimulatorControl.frameworkinside the "Claude iOS Sim" helper app, so theidb_not_installederror code label is itself misleading.- Root cause verified by inspecting
~/Library/Logs/Claude/main.logand the app'sapp.asarbundle: the availability check resolvesrealpath(/var/db/xcode_select_link)and stats<path>/Platforms/iPhoneSimulator.platform; when the symlink is missing, this check fails even thoughxcode-select -psucceeds via its own fallback chain. - The sandbox profile (
claude-ios-sim.sb) applied to the sidecar helper restrictsprocess-execto the helper bundle,/usr/bin,/usr/libexec, the resolved Xcode app, and/Library/Developer— so installingidbvia Homebrew or Nix would not have helped even if it had been the actual cause (it wasn't).