Skip to content
Latchkey

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 PATH

Common 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 xctest

Install the missing component

  1. Identify which platform component provides the utility.
  2. Install it on the runner image.
  3. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →