70% of iOS Sessions Wait on Xcode
By Jin Li (@jinfizz / github.com/kiyoakii) | 2026-11-24
When I started running Claude Code across my production iOS and watchOS app (77.7 MB .ipa, 140.5 MB unpacked .app, 7 nested bundles), the sessions felt slow even on an Apple Silicon Mac. I assumed model latency was the bottleneck. Pulling the raw session transcripts proved the opposite: across 317.4 min of recorded engineering work, the model spent 95.2 min (30%) thinking and 222.2 min (70%) blocked on local Xcode, simulator, and upload tools.
Every minute spent waiting on a serial xcodebuild lock or a 140.5 MB simulator reinstall stalls the feedback loop between edits. I built XCLoom as a Fair Source (FSL-1.1-ALv2, converting to Apache-2.0 after 2 years; Agent Skills Apache-2.0) local CLI to remove those local waits at each layer of the iOS build, simulator, signing, and upload stack.
What the Session Transcripts Measured
I audited two full-length Claude Code sessions (Session A and Session B) from this production app, splitting wall-clock time into LLM generation versus local tool execution.
| Metric | Session A | Session B | Combined |
|---|---|---|---|
Total wall-clock duration | 208.2 min | 109.2 min | 317.4 min |
LLM thinking time | 61.1 min (29%) | 34.1 min (31%) | 95.2 min (30%) |
Local tool wait time | 147.1 min (71%) | 75.1 min (69%) | 222.2 min (70%) |
UI driver runs | 84.1 min (53 runs, avg 95s, max 611s) | 41.6 min (17 runs, avg 147s, max 648s) | 125.7 min (70 runs) |
Build + drive runs | 45.5 min (9 runs, max 968s) | 26.5 min (5 runs, max 607s) | 72.0 min (14 runs) |
Build script invocations | 9.4 min (10 runs, max 233s) | 3.7 min (7 runs, max 78s) | 13.1 min (17 runs) |
Other local tools | 8.1 min | 3.3 min | 11.4 min |
In a separate UI regression log, 19 simulator UI verification runs consumed 25 min on their own.
Shipping builds showed the same pattern. Across a 5-build TestFlight baseline (8.8–11.1 min end-to-end), local machine time took 4.0–7.1 min per release before Apple server processing added another 3–5 min:
xcodebuild archive: 128–155s in normal runs, spiking to 284s when adding.treatWarning(..., as: .error)inPackage.swiftdropped cache hits to0/3419(invalidating all 3,419 cached tasks).xcodebuild -exportArchive: 40–49s.altoolupload (used by the baseline release pipeline): 67–118s.- Apple server processing: 3–5 min.
Four Concrete Root Causes in the Logs
Tracing the slowest tool calls exposed four mechanical bottlenecks inside the default toolchain workflow.
1. Reinstalling 140.5 MB per UI state
To reset app state between UI checks, the verification harness ran a full simctl uninstall followed by simctl install of the 140.5 MB unpacked .app bundle with all 7 nested bundles. Copying and re-registering 140.5 MB through CoreSimulator dominated the 84.1 min and 41.6 min UI driver buckets even when the binary had changed by a single Swift expression.
2. Short-lived accessibility polling and 30-second timeouts
The UI driver polled the simulator accessibility tree in 0.3s loops with 30s selector timeouts. Whenever a view hierarchy shifted or a screen rendered an unexpected state, a single check sat idle for 30s before reporting failure, pushing individual runs to 611s and 648s.
3. Serial xcodebuild queue locks and path-coupled DerivedData
My legacy build script serialized xcodebuild behind a single queue lock to avoid DerivedData corruption. Across recorded runs, its real wall-clock range was 32–233s (including queue lock contention and cache invalidation), and spinning up a second git worktree for a parallel agent forced a cold rebuild because Xcode bakes absolute worktree and DerivedData paths into its dependency tracking.
4. Stock simulator concurrency limits
A stock iOS Simulator boots dozens of background daemons (CloudKit, Spotlight, News, Weather, Tips, and system telemetry) that unit tests and UI verification never call. Booting multiple stock simulators for parallel worktrees drives host memory pressure and triggers CoreSimulator boot storms, forcing agents to serialize onto one simulator instance.
How XCLoom Addresses Each Layer
I structured XCLoom into four independent CLI layers that you can adopt incrementally without rewriting your Xcode project.
Layer 2: Warm .dylib Patching and Single-RunLoop Matrix Checks
# Requires hot-index.json from a prior `xcloom build --local`
xcloom hot --repo . --json
# Standalone 4-state UI audit (leases App-Aware slim sim, injects probe, captures 2x2 PNG, shuts down on exit)
# Defaults to light, dark, compact, dark-ax-xxxl; pass --states light,compact,dark-ax-xxxl,rtl for RTL
xcloom matrix --repo . --json
# Same 4-state probe on an already-booted simulator launched with libxcloom_matrix_probe.dylib
# Defaults to Light, 375pt Compact, Dark + AX-XXXL, RTL
xcloom canvas matrix-act --udid <BOOTED_SIM_UDID> --bundle-id com.example.app --jsonWhen an edit changes a function or SwiftUI body without altering stored type layouts, XCLoom compiles only the changed unit into a small .dylib and injects it into the running app without reinstalling the .app bundle. For visual checks, xcloom matrix runs standalone end to end: it leases an App-Aware slim simulator, injects libxcloom_matrix_probe.dylib, captures a 2x2 PNG across light, dark, compact, dark-ax-xxxl by default (pass --states light,compact,dark-ax-xxxl,rtl for RTL), and shuts down cleanly on exit. On an already-booted instrumented simulator, xcloom canvas matrix-act runs the same single-RunLoop 4-state probe (Light, 375pt Compact, Dark + AX-XXXL, RTL by default) and red-boxes both UILabel text truncation and view-tree viewport overflow clipping.
- Production iOS app warm
.dylibpatch: 0.36s (63 KB patch instead of reinstalling 140.5 MB). apple/sample-food-truckwarm.dylibpatch: 0.37s.- Single-RunLoop 2x2 red-box layout check (
xcloom canvas matrix-acton a pre-booted slimiPhone 17, excluding boot and first launch): 1.44s (1441.4 ms CLI 3-round median / 1468.6 ms probe median on the full SwiftUI + Swift Chartsapple/sample-food-truckapp; 0.064s / 63 ms probe median on the minimal UIKitMatrixSweepOraclefixture, 0 leaked simulators).
This removes both the simctl uninstall/install penalty and the 0.3s polling loop for layout and state checks.
Layer 3: Built-In Slim Simulator Pool
xcloom sim lease --ttl-secs 900 --json
xcloom sim status
xcloom sim lease --release <udid>XCLoom includes a built-in slim simulator pool with no external simslim dependency. Before booting a simulator, XCLoom applies a dual-tier categorized disabled.plist policy organized into 19 daemon categories (147 default-disabled / 160 total categorized) while keeping 24 critical daemons always protected: com.apple.assistantd (disabling it triggers Spotlight memory leaks), 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. The +0.53–0.57s cold boot delta reflects pre-boot disabled.plist backup and merge plus launchd_sim startup adjustment when 147–160 services are masked. The pool enforces 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) to prevent CoreSimulator boot storms, and uses owner-PID + TTL lease tracking with automatic background reaping so crashed agent runs do not leave orphaned simulators behind, without touching simulators booted outside XCLoom.
- Safe Default (default
xcloom sim boot, 147 disabled entries; keepswidgets,store, andphotosenabled; pass--stockto opt out):ri_phys_footprint1.88 GiB -> 1.50 GiB(-20.3%, -0.38 GiB),launchd_simprocesses213 -> 140(-34.3%), cold boot wall time2.37s -> 2.94s(+0.57s). - App-Aware Auto-Slim (
xcloom sim boot --for <App.app | .>, auto-enabled inxcloom run --smoke,xcloom matrix, andxcloom test; static entitlement,Info.plist,.appex, andLC_LOAD_DYLIBanalysis in 2–15 ms, disabling unusedwidgets,store, andphotosup to 160 entries): measured onMinimalApp.app,ri_phys_footprint1.70 GiB -> 0.72 GiB(-57.3%; unrounded1.695 -> 0.724 GiB, -0.97 GiB),launchd_simprocesses190 -> 85(-55.3%), cold boot wall time2.49s -> 3.02s(+0.53s).
You can estimate safe concurrency for your machine's RAM on /tools/simulator-ram-calculator/.
Layer 4: Keychain-Free Signing, Offline Preflight, and Direct Upload
# Interactive one-time import of your Development signing identity
xcloom sign import-keychain --team-id <TEAM_ID>
# Dedicated release host only (adds Apple Distribution):
# xcloom sign import-keychain --team-id <TEAM_ID> --include-distribution
# Local Release archive, offline preflight, and chunked ASC upload
# upload-asc reads ~/.appstoreconnect or ASC_KEY_ID, ASC_ISSUER_ID, and ASC_PRIVATE_KEY_PATH / AuthKey_<ID>.p8
xcloom archive --local --engine direct --out ./Release.ipa --json
xcloom preflight ./Release.ipa --method app-store --json
xcloom upload-asc ./Release.ipa --bundle-id com.example.app --short-version 1.0 --build-number 1 --jsonTo eliminate background Keychain dialogs and late App Store rejections, XCLoom requires an interactive TTY to import your signing identity once into a 0700 Time-Machine-excluded team directory and computes CMS signatures directly in process. The store writes encrypted kc_<fp>.p12, a 0600 .p12.password, and kc_<fp>.cer, zeroizing secret buffers on drop. That protects against stray plaintext .key.pem files, Time Machine key leaks, other macOS user accounts, and headless Keychain exports without a TTY; it does not isolate against other unsandboxed processes running as the same macOS user (since the sibling .p12.password enables unattended signing). Development imports omit --include-distribution, while Distribution and Release imports require explicit --include-distribution opt-in (omitting it returns XCLOOM-SIGN-DISTRIBUTION-OPT-IN-REQUIRED):
- Signing time: 0.43s self-signed CMS signing (9-run median, 85 MB / 27 bundles), verified with
/usr/bin/codesign --verify --deep --strict, with zero background Keychain prompts. Full Apple Distribution signing with RFC 3161 TSA timestamping, physical iPhone install, and App Store Connect acceptance is not yet measured on a device; standardcodesignandxcodebuildremain available anytime. - Offline preflight (
xcloom preflight): 0.39s single trial on an 85 MB.ipa, 1.87s on the 77.7 MB production App Store.ipa, and 0.66s (--method development) to 3.11s (--method app-store) 9-run median on a 149 MB.ipa, checking 22ITMS-*packaging and Privacy Manifest rules (includingITMS-91053andITMS-91056PrivacyInfo.xcprivacyrequired-reason API checks) plus 9XCLOOM-252-*Guideline 2.5.2 checks for leaked XCLoom dev-time hot-reload markers (31 total offline checks) before a single byte leaves the Mac. - Direct chunked upload (
xcloom upload-asc): 25.1s in15 chunks over a 16-stream HTTP/2 poolon the 77.7 MB.ipa(reading~/.appstoreconnectcredentials orASC_KEY_ID,ASC_ISSUER_ID, andASC_PRIVATE_KEY_PATH/AuthKey_<ID>.p8), compared to 67–118s withaltool. - End-to-end delivery measurements pending verification: side-by-side
.devQR OTA install (not yet measured on a device), on-device.dylibhot reload (not yet measured on a device), and signed TestFlight local pipeline (not yet measured).
Fallback Boundaries
I designed XCLoom to be explicit about what it handles directly and where it falls back or stops:
- Direct build scope and fallback: local Debug
build,run,hot, andtestdefault todirectunder--engine autofor.xcodeproj,.xcworkspace, CocoaPods, and XcodeGen (project.yml) apps via native compiler rules and per-target hybrid delegation; standalonePackage.swiftapps, unsupported custom build rules, and Xcode-only build phases fall back toxcodebuildand emit an explicitengine_fallback_reasonfield in JSON output. Local Release builds andxcloom archive --localdefault toxcodebuildunder--engine autoand support explicit--engine direct(xcloom archive --local --engine direct), whilexcloom testflightbuilds viaxcodebuild(pairxcloom archive --local --engine directwithxcloom preflightandxcloom upload-ascfor a direct-engine release pipeline). - Hot-patch layout boundary: adding or reordering stored properties on a
struct,class, oractor, or adding and deleting Swift source files, cannot be patched via.dylib.xcloom hotreturnsrequires_full_rebuild: trueso you runxcloom build --local, whereasxcloom dev --watchtriggers the full incremental rebuild automatically. - Compiler flag invalidation: changing compiler flags (such as adding
.treatWarning(..., as: .error)inPackage.swift) changes the cache key and still invalidates affected compilation units. Runxcloom build --local --engine xcodebuild --explain-cache(without--json) orxcloom cache-why MyApp --repo . --jsonto diagnosexcodebuildand fallback cache misses; direct-engine builds report per-targetcas_hits/cas_missesdirectly. - Preflight and App Review scope:
xcloom preflightcatches 22 structural and Privacy ManifestITMS-*errors (includingITMS-91053andITMS-91056) plus 9XCLOOM-252-*checks for leaked XCLoom dev-time hot-reload markers (31 total offline checks), but it does not statically prove absence of arbitrary third-partydlopenor interpreter code, and it cannot shorten Apple's 3–5 min server-side TestFlight processing window.
Where to Go Next
- Inspect reproducible benchmark scripts and raw timings on /benchmarks/.
- Size your parallel agent fleet with /tools/simulator-ram-calculator/.
- Compare XCLoom against MobileBuildMCP,
xcrun mcpbridge, Tuist,simslim, andfastlaneon /vs/. - Troubleshoot common
DerivedDatalocks, simulator OOMs, Keychain hangs, andITMS-*rejections in /errors/.

# 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.