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
- List installed Xcodes on the runner.
- Select the full Xcode.app rather than the Command Line Tools.
- 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-pathPin 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/DeveloperHow 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-pathearly to catch a bad developer directory.
Related guides
xcodebuild "Unable to find a destination matching the provided destination specifier" in CIFix xcodebuild "Unable to find a destination matching the provided destination specifier" in CI - the request…
Swift "Could not find module 'X' for target" in CIFix Swift "Could not find module 'X' for target 'arm64-apple-ios-simulator'" in CI - a prebuilt module was no…
fastlane gym "Error building the application" in CIFix fastlane gym "Error building the application - see the log above" in CI - the underlying xcodebuild archi…