Xcode "Unable to find a destination" in CI
xcodebuild was asked to build or test against a destination - a simulator or device - that does not exist on the runner. The named device, OS version, or platform is not installed.
What this error means
xcodebuild aborts before compiling, printing that it cannot find a destination matching your -destination specifier and listing the destinations that are available. It is deterministic: the specifier simply does not match any installed runtime.
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:17.5, name:iPhone 15 }
Available destinations for the "App" scheme:
{ platform:iOS Simulator, OS:18.2, name:iPhone 16 }Common causes
The named simulator or OS is not installed
A hardcoded name:iPhone 15,OS:17.5 only works if that exact device and runtime are installed on the runner. A newer Xcode image ships different default simulators, so the pin no longer matches.
Wrong scheme or platform in the specifier
A typo in the scheme, or asking for platform:iOS (a physical device) on a runner that only has simulators, leaves no matching destination.
How to fix it
List the destinations the runner actually has
Ask xcodebuild what it can target, then pick one of those.
xcodebuild -showdestinations -scheme App -workspace App.xcworkspace
xcrun simctl list devices availableTarget a device family instead of a fixed name
Specifying only the platform lets Xcode choose any available simulator of that type, so the build survives image upgrades.
xcodebuild test -scheme App -workspace App.xcworkspace \
-destination 'platform=iOS Simulator,name=iPhone 16'
# more robust: let Xcode pick the latest available
xcodebuild test -scheme App -destination 'generic/platform=iOS Simulator'Install the runtime you need
- If you must pin an older OS, install that simulator runtime on the runner first.
- Use
xcodebuild -downloadPlatform iOSorxcrun simctl runtimeto add it. - Prefer matching the Xcode version your image ships to avoid downloading runtimes every run.
How to prevent it
- Avoid hardcoding a simulator name/OS that ties you to one runner image.
- Pin the Xcode version so the available simulators stay predictable.
- Query
-showdestinationsin CI before building if device choice matters.