xcodebuild destination unavailable or ineligible

xcodebuild errors out that the destination is unavailable or ineligible — no device matches the specifier — instead of running tests.

Partial fit Likely class: destination matching / device eligibility · Updated

Symptom

xcodebuild does not hang — it fails fast with a destination error and never starts testing. The message says it cannot find a device matching your -destination, or it lists your intended device under “Ineligible destinations”.

What it usually looks like

Common messages:

This is different from xcodebuild hanging while resolving a destination: here you get a clear error rather than an open-ended stall.

Why it happens / likely failure classes

The destination specifier did not match a usable device. Typical causes:

Quick checks

# What devices and runtimes actually exist for the selected Xcode?
xcrun simctl list devices available
xcrun simctl list runtimes

# What does Xcode consider a valid destination for your scheme?
xcodebuild -showdestinations -scheme YourScheme -workspace YourApp.xcworkspace

# Are you pointed at the Xcode you think you are?
xcode-select -p

If simctl list runtimes does not include the OS you are targeting, the destination is unavailable because the runtime is missing — install it before anything else.

Manual mitigations

When XCSteward may help

This is a partial fit. XCSteward is designed to run against a concrete, verified destination, so it can:

It is worth testing against this class of failure when the destination exists but keeps getting selected inconsistently across runs.

When XCSteward probably will not help

Common questions

What does "xcodebuild destination unavailable or ineligible" usually mean?
It usually points to destination matching / device eligibility. xcodebuild errors out that the destination is unavailable or ineligible — no device matches the specifier — instead of running tests. Start by checking simulator readiness, destination selection, CoreSimulator/simctl responsiveness, and whether another xcodebuild, simctl, or Simulator process is already active before treating it as a test-code failure.
Can XCSteward help with "xcodebuild destination unavailable or ineligible"?
This is a partial fit. XCSteward may help when the failure comes from execution readiness, destination selection, timeouts, cleanup, or contention. It probably will not help when the root cause is missing configuration, a broken runtime, a test-code bug, or a vendor image defect.
What should I check first?
Check whether xcrun simctl commands return promptly, whether xcodebuild can resolve a concrete simulator destination, whether the device is truly ready rather than merely Booted, and whether concurrent agents, scripts, or manual runs are touching the same simulator subsystem.