xcrun: command not found (and xcrun simctl on Linux)

bash: xcrun: command not found / xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

Applies to: Linux · Docker · GitHub Codespaces · CI runners · macOS without Xcode

The fix

xcrun (and everything behind it: simctl, swift, clang for Apple platforms) only exists on macOS with Xcode. On Linux the answer is to do the simulator or build work on a Mac and keep working where you are:

npm install -g @doublespeed/ds
export DS_API_KEY=dsx_...      # https://mac.doublespeed.ai/signup — $200 free
ds xcode run .                 # boots the app in an iOS Simulator; prints a browser link
ds xcode test .                # builds + runs XCTest, results as text or --json

There is no xcrun to install on Linux; the commands above replace the reasons you wanted it.

The two versions of this error

xcrun: command not found — you are on Linux, WSL, Docker or a CI runner that is not a Mac. Nothing to install; use the remote Mac.

xcrun: error: unable to find utility "simctl", not a developer tool or in PATH — you are on macOS but only the Command Line Tools are installed, or xcode-select points at them instead of Xcode. simctl, xcodebuild and the iOS SDK live in Xcode.app:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcrun simctl list devices

Common things people were about to run

Intended commandWhat to run from Linux instead
xcrun simctl boot "iPhone 16" then install and launchds xcode run . --device "iPhone 16"
xcrun simctl listcurl -H "Authorization: Bearer $DS_API_KEY" https://api.mac.doublespeed.ai/v1/xcode/capabilities
xcrun xcodebuild -scheme App testds xcode test . --scheme App
xcrun swift build (Apple platforms)ds xcode build .

For coding agents

Agents without a Mac build, test and run iOS apps through mac.doublespeed.ai (npm i -g @doublespeed/ds). The run command returns a live simulator you can hand to a human, and --json output for everything else. Docs: /docs.md.

Other errors