[BUG] iOS Simulator pane misreports "Xcode not selected" when /var/db/xcode_select_link is absent (auto-discovery fallback not checked)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 22, 2026

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

  1. Install Xcode and never run xcode-select -s (so /var/db/xcode_select_link does not exist; the system relies purely on auto-discovery)
  2. Confirm xcode-select -p returns a valid path (proving auto-discovery works)
  3. In Claude Code Desktop, attach to the iOS Simulator
  4. Observe the idb_not_installed error with the "Xcode is installed but not selected" message
  5. Confirm ls /var/db/xcode_select_linkNo 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_link resolves the issue immediately — this simply recreates the symlink that xcode-select -s would normally create as a side effect.
  • idb/idb_companion are not an external dependency — they're fully bundled as FBControlCore.framework / FBSimulatorControl.framework inside the "Claude iOS Sim" helper app, so the idb_not_installed error code label is itself misleading.
  • Root cause verified by inspecting ~/Library/Logs/Claude/main.log and the app's app.asar bundle: the availability check resolves realpath(/var/db/xcode_select_link) and stats <path>/Platforms/iPhoneSimulator.platform; when the symlink is missing, this check fails even though xcode-select -p succeeds via its own fallback chain.
  • The sandbox profile (claude-ios-sim.sb) applied to the sidecar helper restricts process-exec to the helper bundle, /usr/bin, /usr/libexec, the resolved Xcode app, and /Library/Developer — so installing idb via Homebrew or Nix would not have helped even if it had been the actual cause (it wasn't).

View original on GitHub ↗