iOS Simulator OOM Under Parallel Agents
Symptom & Root Cause
Booting multiple stock iOS Simulators simultaneously across parallel coding agents drives macOS into memory compression, causes CoreSimulatorService timeouts, and leaves orphaned simulators consuming gigabytes of RAM after test scripts crash. Each stock simulator launches dozens of background daemons irrelevant to app testing, and uncoordinated simctl boot calls compete for CPU and disk I/O while repeated simctl uninstall and simctl install cycles churn 140.5 MB bundles per state.
Exact Diagnostic & Fix Commands
Inspect currently booted simulators, their ri_phys_footprint physical memory footprint via xcloom sim status, and macOS memory pressure:
# Inspect XCLoom fleet status with accurate ri_phys_footprint (RAM, slim/stock mode, owner agent, orphans)
xcloom sim status
# List all booted simulators
xcrun simctl list devices booted
# Inspect memory pressure on macOS
memory_pressure -Q
# Process discovery only (do not use ps RSS to measure simulator RAM; ps RSS double-counts shared dyld pages)
ps -axo pid,comm | grep -E "launchd_sim|CoreSimulator|SpringBoard" | head -n 20Shut down only the idle simulator UDIDs that your own workflow booted (avoid shutdown all on shared machines):
# Shut down a specific simulator UDID you own
xcrun simctl shutdown <UDID>
# Reap orphaned simulators that were booted by XCLoom only
xcloom sim lease --reap-once --jsonHow XCLoom Prevents Recurrence
XCLoom manages a built-in slim simulator pool with no external simslim tool required. Before boot, it applies a dual-tier categorized disabled.plist policy spanning 19 daemon categories (147 default-disabled / 160 total categorized) while keeping 24 core daemons always protected: com.apple.assistantd (disabling it triggers Spotlight memory leaks in the simulator), com.apple.gamed (disabling it stalls XCUITest DTServiceHub launches), and com.apple.coredevice.dtuhidd (needed for CoreSimulator host bridging and HID control, including iPhone Duo). Passing --stock restores the exact original disabled.plist bytes.
- Safe Default (default
xcloom sim boot, 147 disabled entries; keepswidgets,store, andphotosenabled; pass--stockto opt out): per-simulatorri_phys_footprintdrops from 1.88 GiB to 1.50 GiB (-20.3%, -0.38 GiB), livelaunchd_simprocesses drop from 213 to 140 (-34.3%), and cold boot moves from 2.37s to 2.94s (+0.57s). - App-Aware Auto-Slim (
xcloom sim boot --for <App.app | .>, auto-enabled inxcloom run --smoke,xcloom matrix, andxcloom test): statically inspects entitlements,Info.plist,.appex, andLC_LOAD_DYLIBin 2–15 ms and disables unusedwidgets,store, andphotosup to 160 entries; onMinimalApp.app, footprint drops from 1.70 GiB to 0.72 GiB (-57.3%; unrounded1.695 -> 0.724 GiB, -0.97 GiB), live processes drop from 190 to 85 (-55.3%), and cold boot moves from 2.49s to 3.02s (+0.53s).
That +0.53–0.57s cold boot overhead comes from pre-boot disabled.plist backup and merge plus launchd_sim startup adjustment when 147–160 services are masked. To prevent host saturation, XCLoom applies hardware-adaptive concurrency caps (2 slim slots on 16 GB Macs up to 12 on 128 GB+ Mac Studio), throttles concurrent cold boots (default 2 slim or 1 stock boot, with opt-in queuing via --wait-secs), and manages pool leases (xcloom sim lease, used automatically by run, matrix, and test) via owner-PID + TTL auto-reaping so crashed agents do not leave leased simulators orphaned. Manual xcloom sim boot instances stay running until you call xcloom sim shutdown, and externally booted simulators remain untouched unless explicitly adopted with --adopt.
Frequently Asked Questions
No. xcloom sim lease tracks ownership and only shuts down or reaps simulators booted by XCLoom; externally booted simulators are left untouched unless explicitly shared with --adopt.
XCLoom defaults to hardware-adaptive limits ranging from 2 slim slots on 16 GB Macs up to 12 on 128 GB+ Mac Studio. You can model your exact RAM budget on /tools/simulator-ram-calculator/.
Instead of running simctl uninstall and simctl install of a 140.5 MB .app per check (which pushed a separate UI regression log to 25 min across 19 runs), XCLoom pairs slim simulator leases with 0.36s (63 KB) warm .dylib patches and single-RunLoop 4-state UI audits (xcloom matrix standalone, defaulting to light, dark, compact, dark-ax-xxxl with --states light,compact,dark-ax-xxxl,rtl for RTL, or xcloom canvas matrix-act on an already-booted instrumented sim defaulting to Light, 375pt Compact, Dark + AX-XXXL, RTL in 1.44s on the full SwiftUI apple/sample-food-truck app and 0.064s [63.8 ms wall / 63 ms probe median] on the minimal UIKit MatrixSweepOracle fixture, detecting UILabel and Vision-OCR SwiftUI Text truncation plus view-tree viewport overflow clipping with 0 leaked simulators).

# Install via Homebrew (or: curl -fsSL https://xcloom.dev/install.sh | sh, installs to ~/.local/bin)
brew install xcloom/tap/xcloom
# Read-only environment and simulator check (zero changes to your project)
xcloom doctor
xcloom sim status
# Wire MCP and Agent Skills into your coding agents (repo-local by default; add --global for user-wide; zero Node)
xcloom mcp install --claude --codex --cursor
xcloom skill install --claude --codex --cursorOr paste one sentence into Claude Code, Codex, or Cursor so the agent installs the CLI, registers MCP and the agent skill, runs a first local build, and optionally installs git merge drivers or benchmarks your repo:
Read https://xcloom.dev/agent-setup.md and set up XCLoom for this repository: install the CLI, register the MCP server and agent skill, verify the environment with xcloom doctor, and run a first local build with xcloom build --local --json. Optionally install the git merge drivers and run xcloom bench --repo . --json (isolated cold xcodebuild comparison; can take several minutes on large repositories).Requires macOS with local Xcode SDKs and compilers. Runs directly on existing .xcodeproj, .xcworkspace, CocoaPods, and XcodeGen projects without format migration; standalone Package.swift apps and unsupported build rules fall back automatically to xcodebuild.