Skip to content
Latchkey

xcrun "SDK ... cannot be located" in CI

xcrun could not find the requested SDK because the active developer directory is set to the standalone Command Line Tools, which do not include iOS SDKs. Pointing xcode-select at a full Xcode resolves it.

What this error means

A build or xcrun call fails with "xcrun: error: SDK 'iphoneos' cannot be located" or "unable to find utility, not a developer tool or in PATH".

xcrun
xcodebuild: error: SDK "iphoneos" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

Common causes

Active developer dir points at CommandLineTools

xcode-select is set to /Library/Developer/CommandLineTools, which has no iOS SDKs, so xcrun cannot locate iphoneos.

The selected Xcode is missing or wrong on the runner

The chosen Xcode.app path does not exist on this image, so xcrun falls back to a directory without the SDK.

How to fix it

Point xcode-select at a full Xcode

  1. List installed Xcodes on the runner.
  2. Select the full Xcode.app rather than the Command Line Tools.
  3. Re-run the build so xcrun can find the iOS SDK.
Terminal
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcrun --sdk iphoneos --show-sdk-path

Pin the Xcode version explicitly

Select a known-present Xcode version so the SDK path is stable across image updates.

Terminal
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer

How to prevent it

  • Select a full Xcode.app in CI, never the Command Line Tools.
  • Pin the exact Xcode version your build supports on the runner.
  • Verify xcrun --show-sdk-path early to catch a bad developer directory.

Related guides

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