Swift "unable to find utility" in CI
xcrun could not find a developer tool it needs. The active developer directory points at the wrong toolchain, or the requested utility is not installed.
What this error means
A build or test step fails with xcrun: error: unable to find utility "X", not a developer tool or in PATH. It is deterministic given the toolchain setup.
swift
xcrun: error: unable to find utility "xctest", not a developer tool or in PATHCommon causes
Wrong active developer directory
xcode-select points at Command Line Tools or a stale Xcode that lacks the requested utility.
Utility belongs to a missing component
The tool ships with a platform or simulator component that is not installed on the runner.
How to fix it
Point at the full Xcode toolchain
Select the Xcode that contains the developer tools.
CI step
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcrun --find xctestInstall the missing component
- Identify which platform component provides the utility.
- Install it on the runner image.
- Prefer a runner image that already bundles the needed tools.
How to prevent it
- Set xcode-select to a full Xcode in CI.
- Pin the Xcode version your tools require.
- Use an image with the needed components preinstalled.
Related guides
SwiftPM "No such module" in CIFix Swift "No such module" compile errors with SwiftPM in CI - a package product is not declared as a target…
Swift "linker command failed" in CIFix Swift "linker command failed with exit code 1" in SwiftPM/Xcode CI - undefined symbols, missing libraries…
SwiftPM "could not resolve package dependencies" in CIFix SwiftPM "failed to resolve dependencies" / version conflicts in CI when packages cannot be checked out or…