Multiple xcodebuild processes on the same Mac

Several xcodebuild/simctl processes run at once on one Mac and start colliding over simulators, destinations, and build state.

Strong fit Likely class: concurrent process contention / shared-state collisions · Updated

Symptom

More than one xcodebuild (or simctl) process is running at the same time on one Mac, and they start interfering — runs hang, grab the same device, or corrupt each other’s output.

What it usually looks like

Why it happens / likely failure classes

The simulator subsystem and default build paths are shared per user, and nothing coordinates independent callers:

Quick checks

# How many simulator-related processes are running right now?
pgrep -lf 'xcodebuild|simctl|Simulator'

# Are multiple runs sharing one booted device?
xcrun simctl list devices | grep -i booted

# Is the subsystem still responsive under the load?
time xcrun simctl list devices available

If failures cluster when several of these are active at once, this is contention, not flaky tests.

Manual mitigations

These work but become a pile of glue to maintain — which is the gap XCSteward aims to fill.

When XCSteward may help

Coordinating concurrent work on one Mac is a core design goal:

A strong candidate to test against this class of failure.

When XCSteward probably will not help

Common questions

What does "Multiple xcodebuild processes on the same Mac" usually mean?
It usually points to concurrent process contention / shared-state collisions. Several xcodebuild/simctl processes run at once on one Mac and start colliding over simulators, destinations, and build state. 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 "Multiple xcodebuild processes on the same Mac"?
This is a strong fit when the failure is operational: simulator readiness, destination resolution, CoreSimulator responsiveness, cleanup, timeouts, or local concurrency. XCSteward may help by making those phases bounded, serialized, and easier to inspect. It will not fix broken tests, code signing, missing runtimes, or vendor image bugs.
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.