Skip to content
Latchkey

macOS runner: "Failed to load CoreSimulator framework" in CI

simctl loaded a CoreSimulator framework whose version does not match the running CoreSimulator service. This happens when xcode-select switched Xcode but the old simulator service is still resident.

What this error means

A simctl or xcodebuild test command fails with "Failed to load CoreSimulator framework." or a "mismatch ... rebuild" message, even though the simulator worked earlier in the job.

CoreSimulator
Failed to load CoreSimulator framework. Error Domain=NSCocoaErrorDomain Code=256
"The bundle ... couldn't be loaded because it is damaged or missing necessary resources."

Common causes

Xcode was switched mid-job

Changing the active Xcode with xcode-select leaves the previous CoreSimulator service running against a different framework version, so loads fail.

A stale simulator service is resident

The com.apple.CoreSimulator.CoreSimulatorService process holds an old framework version that no longer matches the selected Xcode.

How to fix it

Restart the CoreSimulator service after switching Xcode

  1. Select the Xcode you intend to use.
  2. Kill the resident CoreSimulator service so it reloads the matching framework.
  3. Re-run simctl or the tests.
Terminal
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo pkill -9 -f CoreSimulatorService || true
xcrun simctl list devices

Avoid switching Xcode after the simulator starts

Pick the Xcode version once at the start of the job so the simulator framework and service stay consistent.

How to prevent it

  • Select Xcode once at the start, before any simulator use.
  • Restart CoreSimulatorService if you must switch Xcode.
  • Pin a single Xcode version per job.

Frequently asked questions

What causes ""Failed to load CoreSimulator framework""?
Changing the active Xcode with xcode-select leaves the previous CoreSimulator service running against a different framework version, so loads fail.
How do I fix "Failed to load CoreSimulator framework"?
Restart the CoreSimulator service after switching Xcode

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card