Builds, tests, previews, signs, verifies, and ships iOS, iPadOS, macOS, visionOS, tvOS, and watchOS apps through the xcloom CLI (65 commands) and its 37 xcloom_* MCP tools. Use when building Xcode, XcodeGen, Tuist, SwiftPM, React Native, Expo, Flutter, KMP, or CocoaPods apps locally or with remote L2 CAS; driving and checking simulators (tree, tap, type, assert, screenshots, matrix sweeps, smoke tests, E2E flows, UX exploration); catching PR regressions (diff-ui, xray size and dead code, feel...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Xcloom?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/xcloom-xcloom)
---
name: xcloom
description: "Builds, tests, previews, signs, verifies, and ships iOS, iPadOS, macOS, visionOS, tvOS, and watchOS apps through the xcloom CLI (65 commands) and its 37 xcloom_* MCP tools. Use when building Xcode, XcodeGen, Tuist, SwiftPM, React Native, Expo, Flutter, KMP, or CocoaPods apps locally or with remote L2 CAS; driving and checking simulators (tree, tap, type, assert, screenshots, matrix sweeps, smoke tests, E2E flows, UX exploration); catching PR regressions (diff-ui, xray size and dead code, feel probes, affected tests); hot-reloading or previewing on simulators and devices; merging .pbxproj and .xcstrings files; reading crash reports, logs, and build traces; explaining Xcode and signing errors; installing .dev builds over OTA or tunnels; compiling Assets.car; running App Store ITMS-* and Guideline 2.5.2 preflight; provisioning, signing without the Keychain, uploading to TestFlight; and comparing .xcarchive or .ipa outputs."
---
# XCLoom Skill Reference
XCLoom replaces `xcodebuild -exportArchive`, `fastlane`, Keychain `codesign`, `actool`, `atos`, and VPN device tunnels with a single binary on macOS and Linux. The CLI has 65 commands (`69` CLI subcommands counting the 4 older cache names), plus `37` `xcloom_*` MCP tools and the headless Canvas HTTP/SSE API. Pass `--json` on CLI commands or call `xcloom_*` MCP tools directly for compact JSON output.
## Which Path to Use
| Situation | Command | What happens |
| --- | --- | --- |
| Local iteration | `xcloom build --local --json` | Builds on this Mac with the working tree as it is. |
| Ad-hoc remote build | `xcloom build --remote --json` | Uploads `--repo` to XCLoom Cloud, or to the self-hosted server configured with `--url` or `xcloom login`. Uncommitted changes go with it and the build is recorded as `<commit>-dirty-<hash>`; pass `--require-clean` to refuse them. `archive` and `testflight` always need a clean tree or `--dirty`. |
| CI (GitHub Actions) | `runs-on: xcloom-macos-m6`, then `xcloom build --local --engine auto --json` | The job already runs on a hosted Mac, so the build is local to the runner and shares the cloud cache. Collect the `.app` with `--products-dir <dir>` or read `app_path` from the `--json` result. |
### Remote MCP (XCLoom Cloud)
- Agents that cannot run the CLI connect to `https://cloud.xcloom.dev/mcp` (Streamable HTTP), which serves 11 `cloud_*` tools for builds, logs, previews, and quota.
- Claude Code needs no token: `claude mcp add --transport http xcloom-cloud https://cloud.xcloom.dev/mcp`, then `/mcp` to sign in on the XCLoom page.
- Clients without MCP sign-in send `Authorization: Bearer <token>`; the user creates the token in the Console under Settings > Tokens (a browser session is required).
- `cloud_build_repo`, `cloud_build_inline`, and `cloud_retry_build` wait up to `wait_seconds` (default 45, at most 85). Codex ends a tool call after `tool_timeout_sec` (60 unless set), so from Codex pass `wait_seconds` of 40 or less.
- A build still running returns `done: false`; keep waiting with `cloud_build_detail`. Errors carry `code` and `next_command`. Setup details: <https://xcloom.dev/agent-setup.md>.
## Execution Modes
| Mode | When to Use | Key Behavior |
| --- | --- | --- |
| **1. Local Embedded CAS (macOS)** | Single-Mac inner loop (`build`, `run`, `dev`, `test`, `archive`, `canvas`), including several agents in several git worktrees | Direct Engine by default with an `xcodebuild` fallback, and one local CAS shared by every worktree (details below) |
| **2. Remote L2 CAS & CI** | Multi-machine / CI cache sharing (`cache serve`, `cache sync`, `build --remote-cas`, `ci`, `login`, `status`) | HTTP L2 CAS server (`xcloom cache serve`, Bearer auth, S3-FIFO quota eviction, Prometheus/JSON `/metrics`) or direct object-storage and shared-volume L2 CAS (`s3://`, `r2://`, `file://`), with per-pin external SwiftPM reuse across repositories; GitHub Actions integration (`deploy/github-actions/xcloom/action.yml`) and `xcloom ci report` / `ci github` |
| **3. Non-SDK Linux Tooling** | Headless Linux CI or build hosts without Xcode (`car`, `sign`, `preflight`, `xray`, `symbolicate`, `upload-asc`, `cache serve`) | Compiles `.xcassets`/`.symbolset` into `Assets.car`, signs and verifies Mach-O/CMS `.app`/`.ipa` bundles without Keychain, runs offline `ITMS-*` + Guideline `2.5.2` preflight, audits binary size/reachability, symbolicates `.dSYM`/`.ips` crashes, uploads to App Store Connect, and serves remote L2 CAS natively on Linux `x86_64` / `aarch64` |
| **4. Off-LAN `.dev` OTA and E2EE Tunnel** | Off-LAN or cellular iPhones (`preview`, `ota --side-by-side`, `tunnel`, `dev --device tunnel`) | User-space HTTP/2 networking (no `utun`, DNS, or route changes), `HTTP 206` Range `itms-services://` `.dev` co-install with `"DEV"` icon badge, and `P-256 ECDH` + `HKDF-SHA256` (`xcloom-e2ee-v1`) + `AES-256-GCM` + raw RFC 1951 Deflate `512 KiB` 16-stream chunk dedup |
Local mode (1) in detail:
- **Engine**: local Debug `build`/`run`/`test` and signed `archive` default to `--engine auto`, which picks the direct engine for supported `.xcodeproj`/`project.yml` apps, unit tests (including Core Data `.xcdatamodeld` via `momc`, Metal, CoreML, Intents, Copy Files, and Xcode 16 synchronized folders), `--platform ios` with signing credentials or `--adhoc-inspect`, and `archive` when signing does not require Keychain IPC or `--xcode-archive`/`--xcode-export`. Anything else falls back to `xcodebuild` and names why in `engine_fallback_reason`.
- **Cache**: an embedded Unix-socket LLVM/Swift CAS (`~/.cache/xcloom/cas-l1`) shared by all worktrees with worktree-independent keys (`/^wt`, `/^dd` prefix maps), shared SDK modules, `Package.resolved`-keyed SwiftPM checkouts (`--locked-packages`), bounded auto-GC, and `--explain-cache` miss attribution.
- **Stable inputs**: a stable `xcodebuild` environment, automatic Swift `.priors` incremental-state repair on verified versions (`XCLOOM_CACHE_FIX_PRIORS=off` to disable), `.xcloom-gen-stamp` preserving `project.pbxproj` `mtime`, a constant compile-time `CURRENT_PROJECT_VERSION=1`, and Release-over-Beta `.xcode-version` selection.
## Commands by Task (65 Commands and `37` MCP Tools)
| Task | CLI Subcommands (`xcloom <subcommand>`) | MCP Tools (`mcp_tools_schema()`) |
| --- | --- | --- |
| **Setup, Diagnostics, Disk, and Skills** | `xcloom init` (one-shot `.xcloom.json` + `.mcp.json` + skills in the home directory + merge drivers in `.git` + Claude Code reload hook in `.claude/settings.local.json` + doctor; `--mcp-clients`, `--repo-skills`, `--skip-*`, `--dry-run`), `xcloom doctor` (`--strict`, exits `1` on critical failures; `--offline` skips the live cloud token check; `--verbose` adds paths and probe details), `xcloom disk` (`audit`, `prune --safe`, `--unsafe-include-archives`), `xcloom explain` (`--build`, `--server`, `--token`, `--fix`, `--apply`, `--fix-id`), `xcloom trace` (`last`, `<log.xcactivitylog>`, `--chrome-trace`), `xcloom toolchain`, `xcloom frameworks` (`detect`, `env`, `prepare`, `snapshot`), `xcloom lsp`, `xcloom bsp` (`buildServer.json` `"argv": ["xcloom", "bsp"]`), `xcloom completions`, `xcloom mcp` (`--profile core\|full`, default `core` lists 11 tools; `install --all` across Claude Code, Codex, Antigravity, Cursor, OpenCode, Zed, VS Code, Windsurf; `--antigravity` / `--agy` writes `~/.gemini/config/mcp_config.json`), `xcloom skill` (`install --all`, `--antigravity`, `--opencode`), `xcloom telemetry` (opt-out, off on first run and in CI; `status` is read-only), `xcloom login` (`--workspace`, `--status`), `xcloom logout`, `xcloom whoami`, `xcloom context` (`list`, `current`, `add`, `use`, `rm`) | `xcloom_disk`, `xcloom_explain`, `xcloom_trace`, `xcloom_toolchain`, `xcloom_frameworks`, `xcloom_skill` |
| **Build, Bench, Bisect, Run, Watch, Test** | `xcloom build` (`--download-app`, `--fresh-vm`), `xcloom xcodebuild` (`--status`, `--clean`, `--products-to`), `xcloom bench`, `xcloom bisect`, `xcloom hot` (`--reload`, `--hook`, `@State`-preserving redraw + new `.swift` files), `xcloom cache why`, `xcloom run` (`--smoke`, `--seed`, `--remote`), `xcloom dev`, `xcloom test` (`--affected`, `--only-failed`, `--retry-flakes`, `--dry-run`), `xcloom clean` | `xcloom_build`, `xcloom_hot`, `xcloom_test` |
| **UI Matrix, Diff-UI, and SwiftUI Canvas** | `xcloom matrix` (`--app`, `--tap`, `--launch-arg`, `--states`, `--capture`, `--settle-ms`, `--include-private-views`, `--seed`, `--parallel`, `--upload`, `--build-id`, `--out`), `xcloom diff-ui` (`<range>` or `--base-dir`/`--head-dir`, `--parallel`, `--init-baseline`, `--baseline-config`, `--comment-pr`, `--dry-run-comment`, `--upload`, `--build-id`, `--out-md`), `xcloom canvas` (`serve`, `init`, `graph`, `populate`, `fork`, `fanout`, `duo-pair`, `fold-toggle`, `variants`, `patch`, `act`, `matrix-act`, `broadcast`, `audit`, `modifiers`, `motion`, `attach-clip`, `record-clip`, `compare`, `versions`, `promote`, `pr-bundle`, `hot-flags`) | `xcloom_matrix`, `xcloom_diff_ui`, `xcloom_canvas` |
| **Merge, Feel, Repro, Branch, Sandbox** | `xcloom merge` (`pbxproj`, `xcstrings`, `check-migrations`, `install-git-driver`), `xcloom feel` (`audit-frames`, `build-probe`, `trait-matrix`, `inspect-report`), `xcloom repro` (`keygen`, `slice-sqlite`, `pack`, `unpack`, `build-shims`, `build-shim`, `replay-sim`), `xcloom branch` (`classify`, `erase-opaque`, `pack`, `unpack`, `sandbox`, `build-runtime`, `switch-sim`, `switch-device`, `clean-store`), `xcloom sandbox` (`build-peripherals`, `run-sim`, `compose-board`, `chaos-check`) | `xcloom_merge`, `xcloom_feel`, `xcloom_repro`, `xcloom_branch`, `xcloom_sandbox` |
| **Off-LAN `.dev` Preview, OTA, and Tunnel** | `xcloom preview` (`--remote`, `--team-id`, `--device-udid`, `--tunnel`, `--live`, `--no-live`, `--no-runtime`, `--persist`, `--passcode`), `xcloom ota` (`--side-by-side`, `--badge`, `--tunnel`), `xcloom tunnel` (`start`, `status`, `wait`, `approve`, `push-dylib`) | `xcloom_ota`, `xcloom_tunnel` |
| **Simulator, E2E, UX, macOS, Device UI, and Logs** | `xcloom sim` (`daemon` (`start`, `status`, `stop`), `status`, `list`, `profiles`, `explain`, `boot`, `shutdown`, `lease`, `install`, `launch` (`--inspect`), `launch-instrumented`, `location`, `privacy`, `locale`, `open-url`, `push`, `capture`, `snapshot` (live `@eN` UI or `save`/`restore`/`list`/`delete`), `tree`, `assert`, `tap`/`type`/`swipe` (`--after-snapshot`, `--settle`, `--display`), `unfold`, `fold`, `hinge`, `rotate`, `calibrate`, `ui`, `screenshot`, `diff`, `logs`, `crashes`, `flow`), `xcloom e2e` (`run`, `import-maestro`), `xcloom ux` (`explore`, `session`, `report`, `verify-pack`), `xcloom logs` (`--since`, `--level`, `--subsystem`, `--raw`), `xcloom macos-ui`, `xcloom device` | `xcloom_sim`, `xcloom_e2e`, `xcloom_ux`, `xcloom_logs`, `xcloom_device` |
| **Asset Catalogs and SPM Packaging** | `xcloom bundle-spm`, `xcloom car` | `xcloom_car` |
| **Provisioning, Signing, and IPA** | `xcloom provision` (`--team-id`), `xcloom sign` (`list-keychain`, `import-keychain`), `xcloom stamp-archive`, `xcloom pack-ipa` | `xcloom_provision`, `xcloom_sign` |
| **Preflight, Verify, CI, and Release** | `xcloom preflight`, `xcloom verify` (`diff-archive`, `diff-ipa`, `checklist`, `pr`), `xcloom ci` (`report`, `github`, `lint`), `xcloom archive`, `xcloom testflight`, `xcloom upload-asc`, `xcloom record` | `xcloom_preflight`, `xcloom_verify`, `xcloom_ci`, `xcloom_testflight` |
| **Binary Size, Order, and Crashes** | `xcloom xray` (`--upload`, `--build-id`, `--base-branch`), `xcloom order-profile` (`--verify`, `--app`, `--ordered-app`, `--linkmap`, `--order-file`, `--out-md`), `xcloom crash` (`latest`, `list`, `<path>`), `xcloom symbolicate` | `xcloom_xray`, `xcloom_order_profile`, `xcloom_crash`, `xcloom_symbolicate` |
| **Remote Status and CAS** | `xcloom builds` (`list`, `view`, `logs --follow\|--errors`, `steps`, `search`, `cancel`, `retry`, `reset-vm`), `xcloom cache` (`stats [--remote]`, `list`, `clear --yes`, `why [vx_...]`, `gc`, `sync`, `serve`, `serve-plugin`), `xcloom usage` (`--period`, `--breakdown-by`), `xcloom tokens` (`list`, `create` from a Console browser session only, `revoke`), `xcloom status` (`--watch`, `--context`, `--cancel`, `--retry`); older names `cache-why`, `cas` (`serve`, `sync-direct`), `cas-serve`, `cas-gc` still run, hidden from `--help` | `xcloom_status`, `xcloom_cas_gc` |
## CLI Conventions
- **`--json`** is accepted by every subcommand, before or after it (`xcloom --json status` = `xcloom status --json`). Results go to stdout as JSON.
- **Errors with `--json`** print `{"ok": false, "error": {"code", "message", "exit_code", "summary", "likely_cause", "next_command"}}` to stdout; result documents carry the same top-level `ok`, and their `error` object has the same fields. MCP error results carry the same document.
- `summary` is one line, `likely_cause` one sentence, and `next_command` one command to run as-is. Placeholders such as `<BUNDLE_ID>` mark values only the user knows; a capitalized sentence means no command fits.
- When the scheme is unknown or could not be picked, `error.available_schemes` lists the choices and `next_command` is `xcloom <command> --scheme <first>`.
- Codes returned alongside a report with `ok: false`: `test_failed` and `test_report_incomplete` (`xcloom test`; the second when an expected test has no result), `sim_assert_failed` (`sim assert`), `sim_diff_failed` (`sim diff`), `not_equivalent` (`verify diff-ipa` / `diff-archive`), `upload_blocked` (`upload-asc --dry-run` whose upload the checks would block), `ci_gate_failed` (`ci report --fail-on-error`), `ci_lint_failed` (`ci lint` found an error), `products_dir_failed` (`build --products-dir` could not place the products), `merge_conflict` (`merge pbxproj` / `merge xcstrings` left conflicts), and `cas_gc_roots_busy` (`cache gc` skipped a root a build is using).
- Other stable codes: `usage_error`, `runtime_error`, `build_failed`, `project_not_found`, `missing_generated_project`, `scheme_not_detected`, `generator_failed`, `ambiguous_booted_simulator` (no `--udid` while several simulators are booted), and `XCLOOM-CLOUD-LOGIN-REQUIRED` (`status`, `usage`, `whoami` and other cloud commands with no saved login; run `xcloom login`).
- Cloud commands also return `auth_failed` (token refused), `unavailable` (the server has no such route yet, `usage --period` it does not report, or a remote build left no `.app`), `build_not_found`, and `logs_purged`.
- In human mode (without `--json`), matching Apple/Xcode errors also append a one-line `Hint: <root_cause> -> <command>` footer on stderr, unless the error already names that command.
- **Exit codes**: `0` success, `1` the command failed (including failed builds, failed gates, `sim diff` mismatch, and `doctor` critical failures or `--strict` warnings), `2` invalid usage (unknown or inapplicable flag, or a flag value clap rejects such as `sim ui --content-size huge`).
- Only run commands shown by `xcloom --help` or listed in this skill.
- **`--dry-run`** on `build`, `archive`, `testflight`, `upload-asc`, `record`: prints the plan (`"status": "dry_run"`, `steps`, `external_changes`) and changes nothing; `upload-asc --dry-run` still runs the 2.5.2 checks and the ITMS preflight on its `.ipa`, lists their findings as arrays, reports skipped checks as `skipped`, and exits `1` with `ok: false` when the real upload would be blocked.
## Common Workflows
### 0. Local Inner Loop (Build, Test, Check, Screenshot)
```sh
xcloom build --local --json # Direct Engine; defaults to ios-simulator; prints app_path
xcloom build --local --configuration Release --json # Release on the Direct Engine: check #if DEBUG branches and size
xcloom test --local --udid <UDID> --shutdown-after --json
xcloom preflight <app_path> --json # a simulator .app gets the simulator precheck
xcloom xray <app_path> --json
xcloom sim screenshot ./shot.png --udid <UDID> --install <app_path> --launch-arg=-tab --status-bar --appearance dark --content-size ax-xxxl --json
xcloom sim screenshot ./duo.png --udid <DUO_UDID> --duo-both --auto-unfold --json # cover + inner, refolds after
```
- Monorepo app with a shared local package outside its directory: `"workspace_root": "../.."` in the app's `.xcloom.json`, or `--workspace-root`. Build caches go to `XCLOOM_CACHE_DIR` when set; signing material stays in `~/.cache/xcloom`.
### PR Verification Loop (`xcloom verify pr`)
```sh
xcloom verify pr --base origin/main --xray --preflight --json
xcloom verify pr --cloud --no-test --matrix --diff-ui --upload --fail-fast --json
```
- Runs the merge-base checklist, local build/test (or `--cloud`/`--remote` build; pass `--no-test` to opt out of tests), and requested optional steps (`--xray` size/dead-code report, `--matrix`, clean-tree `--diff-ui`, `--preflight`, `--upload`); exits non-zero if any requested step fails or is unavailable.
### 1. Local Simulator and Canvas Workflow
```sh
xcloom doctor --repo . --json
xcloom init --lsp # writes buildServer.json (`"argv": ["xcloom", "bsp"]`); with Claude Code installed, PostToolUse and UserPromptSubmit hooks (`xcloom __agent-hook`: hot reload, unread device feedback) in .claude/settings.local.json
xcloom canvas init --json && xcloom canvas populate --json
xcloom canvas duo-pair --node root --json
xcloom canvas variants --node root --count 2 --prompt "Increase CTA contrast and 44pt hit targets" --json
xcloom canvas audit --node node-1 --json
xcloom sim lease --device-type "iPhone Duo" --ttl-secs 900 --ttl-only --json # JSON `token`: pass it as --lease-token
xcloom sim unfold --json && xcloom sim rotate landscape-left --json
xcloom sim screenshot ./duo-cover.png --duo-both --auto-unfold
xcloom sim fold --json
xcloom test --filter CheckoutTests --json
```
- **Expected output**: Exit `0`.
- `populate` creates at most 12 worktree nodes per run; `variants` without `--agent-cmd` only stores the prompt (`agent_status: "needs_agent"`).
- `audit` needs a view tree captured from a booted macOS host preview (otherwise it prints `NO EVIDENCE` and exits non-zero), then returns `"passed": true` when it finds no `warning`/`error`.
- `test --json` returns `{"ok":true,"failed":0,...}` (a `crashes` list appears only when a test run crashed).
- **Simulator leases**: release them when finished (`xcloom sim lease --release <udid> --lease-token <token>`); a `--ttl-only` lease is used, renewed, and released only with its `token`. Simulators are shared: `sim lease` never takes a simulator someone else booted unless you pass `--adopt`, and XCLoom only shuts down simulators it booted.
- **Boot queue**: set `XCLOOM_SIM_BOOT_CMD` (argv with `{udid}`) to route every boot through the machine's own boot queue (a `sim-boot` on `PATH` is used the same way). `xcloom test --udid <UDID> --shutdown-after` boots through it and shuts down only a simulator that run booted.
- **Input and capture**: `sim tap` / `type` / `swipe` / `button` / `key` / `screenshot` and `sim tree` / `snapshot` use XCLoom's native CoreSimulator HID (`dtuhid_xpc` on Xcode 27+, `indigo_hid` earlier), `IOSurface` capture, CoreSimulator accessibility translation, and the built-in `libXCLoomHotAgent.dylib` view inspector.
### 2. Side-by-Side `.dev` OTA and HTTPS Relay Live Patch
```sh
# Zero-flag live `.dev` preview on a real iPhone: builds, signs, adds SwiftUI source tags,
# picks XCLoom relay (`xcloom login`) or local `cloudflared`, and prints QR + 6-digit pair code
xcloom preview --live [--json]
# Optional overrides when needed: --team-id <ID>, --device-udid <UDID>, --tunnel relay|cloudflare, --entitlements auto|verify|rewrite|strip, --on-feedback CMD, --persist
# Rewrite side-by-side .dev app ("DEV" icon badge + dev- URL schemes), sign, and serve HTTPS 206 OTA
xcloom ota ./build/App.ipa --side-by-side --p12 ./AppleDevelopment.p12 --profile ./AppDev.mobileprovision --badge DEV --tunnel --once --json
# Single-file or newly added .swift hot patch on a simulator or paired device (@State preserved; rebuilds automatically when layout changes)
xcloom hot --local --reload [--file App/HomeView.swift] [--json] # also MCP `xcloom_hot` or `xcloom hot --hook`
xcloom dev [--watch] [--json]
xcloom tunnel status --json
# Agent loop with `preview --live` running: blocks on active room (no room flags needed)
xcloom tunnel wait --for paired --json
xcloom tunnel wait --for feedback --json # next Circle & Pin note or 15 s trace
```
- **Expected output**: Exit `0`; `ota --json` emits `bundle_id` ending in `.dev` (idempotent, never `.dev.dev`), `install_url`, and `manifest_url`; `tunnel status --json` shows `"paired": true` and the device's `device_fingerprint` (code goes only to an approved fingerprint: prompt, `--accept-device`, or `tunnel approve`; room tokens and pair secrets never appear in JSON); each `device_hot_patch` event reports `"receipt": "confirmed"` with the device's `rebound_swift`/`rebound_objc` (a missing receipt is a failed event with the device's delivery state), with `0` host `utun` or DNS changes. `xcloom preview` and simulator `xcloom hot --reload` inject the runtime automatically with `@State`-preserving SwiftUI redraws (no `XCLoomHotAgent.shared.start()` edits in user app code). `tunnel wait --json` prints one object (`event`: `paired`, `ack`, `pin`, or `trace`; pin/trace carry `seq`, `artifact_kind`, `source_tag`, `note`, `artifact_path`, `voice_path`; a pin adds `hit_label` and `screenshot_path` (a JPEG of the page with the circle drawn on it) when the device sent them, a `voice_pin_batch` pin adds `item_count` and `screenshot_paths`) and exits `0`; `XCLOOM-TUNNEL-WAIT-TIMEOUT` after `--timeout` (default 300 s). Full device setup and manual embedding details: `references/ota-and-cloudflare-tunnel.md`.
### 3. Non-SDK Linux Tooling and Remote L2 CAS
```sh
xcloom car compile ./App/Assets.xcassets --out ./build/resources --platform ios --min-deployment-target 17.0 --json
xcloom sign ./App.app --p12 ./dist.p12 --p12-password-env XCLOOM_P12_PASSWORD --json
xcloom preflight ./App.ipa --method app-store --json
xcloom xray ./App.ipa --json && xcloom symbolicate --dsym ./App.dSYM --crash ./App.ips --json
xcloom cache serve --listen 127.0.0.1:1925 --storage-dir /var/lib/xcloom-cas --token "$XCLOOM_REMOTE_CAS_TOKEN" --max-gb 20
xcloom build --local --remote-cas http://127.0.0.1:1925 --remote-cas-token "$XCLOOM_REMOTE_CAS_TOKEN" --json
```
- **Expected output**: Exit `0` natively on Linux `x86_64`/`aarch64` without Xcode (`scripts/verify-linux-nonsdk.sh` verifies all 7 flows end to end); `preflight --json` returns `"ok": true, "issues": []`; unreproducible asset entries fail closed with `XCLOOM-CAR-UNSUPPORTED`. Remote L2 CAS also supports `s3://`, `r2://`, and `file://` backends directly with no control-plane server required.
### 4. App Store Preflight, Differential Verify, and TestFlight
```sh
xcloom archive --out ./Candidate.ipa --json
xcloom preflight ./Candidate.ipa --method app-store --json
xcloom verify diff-ipa ./Baseline.ipa ./Candidate.ipa --json
xcloom ci report ./Candidate.ipa --baseline ./Baseline.ipa --fail-on-error --json
xcloom testflight --wait --changelog "Faster startup and reliability fixes" --groups "Internal QA" --json
```
- **Expected output**: Exit `0`; `preflight` reports `0` `ITMS-*` errors and `0` `XCLOOM-252-*` hot-reload markers across all Thin, FAT, and FAT64 slices; `verify diff-ipa` reports `"structurally_equivalent"` (file tree, `+x`, plists, Mach-O slices, entitlements) and `"content_equivalent"` (SHA-256 per file; Mach-O hashed without code signature and `LC_UUID`), lists every normalized difference in `normalized[]`, and `"equivalent": true` means content-equivalent; `ci report` returns `"passed": true`. For a full pre-submission App Review Guideline audit (source, metadata, StoreKit, privacy, and Resolution Center response), use the companion [xcloom-appstore-review](../xcloom-appstore-review/SKILL.md) skill.
## Troubleshooting
| Symptom | Cause | Command |
| --- | --- | --- |
| `0%` CAS hit rate across PR branches | Missing `.xcloom.json` or dynamic compile `CURRENT_PROJECT_VERSION` | `xcloom init` or pass `--fallback-config ./default.json` to `xcloom ci github` |
| New worktree or agent hand-off rebuilds everything | Cache keys or task signatures carry a path, flag, input or environment difference | `xcloom build --local --explain-cache --json` or `xcloom cache why [Target] --repo . --json` (see `cache_report.reasons` and `uncacheable_by_category`) |
| `xcodebuild` replans the build graph on a 1-line edit | Generator rewrote `project.pbxproj` `mtime` outside XCLoom | Run `xcloom build` (uses `.xcloom-gen-stamp` to skip generator when structure is unchanged) |
| `ITMS-90111` rejected by App Store | Archive built with Beta/Seed Xcode (`DTXcodeBuild`) | `xcloom toolchain status --policy release-app-store --json` then `xcloom archive --xcode 26.4` |
| `XCLOOM-252-*` blocks release upload | XCLoom dev-time residue (`XCLoomHotAgent`, `XCLoomDeviceAppHotAgent`, `__swift5_replace`, `__DATA*` `_$s...TX`, `get-task-allow`) in Release; the gate does not check `dlopen`/JIT/interpreters | Rebuild clean Release (`-enable-implicit-dynamic` off) and verify `xcloom preflight ./App.ipa --json` |
| `ITMS-90046` / `ITMS-90347` failure | `get-task-allow=true` in Release or `.appex` bundle ID prefix mismatch | `xcloom preflight ./App.ipa --method app-store --json` |
| HTTPS `.dev` OTA install stalls or fails `0xe800003a` | Server lacks RFC 9110 `HTTP 206` Range or `.appex` missing `.dev` prefix | `xcloom ota ./App.ipa --side-by-side --tunnel --json` |
| `xcloom ota` exits with "would not install on a device" | Ad-hoc signing, profile missing for an extension, App Store profile, unregistered UDID, or an entitlement the `.dev` profile does not grant | Pass `--p12`/`--cert`+`--key`, `--profile`, `--extension-profile`, `--entitlements rewrite`; see the OTA prerequisites in the OTA reference guide (`--adhoc-inspect` only inspects) |
| "Unable to install" after OTA, or login callback opens the wrong app | Developer not trusted on the device, or both apps claim a third-party URL scheme | Settings > General > VPN & Device Management; keep SDK schemes (default) or `--url-scheme-include` and register the new callback |
| `engine=auto falling back to xcodebuild` with `XCLocalSwiftPackageReference ... resolves outside source_root` | Monorepo app references a shared local package outside its repo directory | `xcloom build --local --workspace-root <monorepo root>` or `"workspace_root": "../.."` in `.xcloom.json` |
| `XCLOOM-XCODEGEN-STALE` on `stderr` | `project.yml` changed after the checked-in `.xcodeproj` was generated | `xcodegen generate`, or `"project_generator": "xcodegen generate"` in `.xcloom.json` |
| `preflight --method app-store` on a Debug simulator `.app` fails `ITMS-90208` / `90045` / `90047` / `XCLOOM-252-SYM` | Simulator builds have no device slice or distribution entitlements; hot-reload builds have `_$s...TX` entries | Drop `--method` (or pass `--simulator-precheck`): these findings become `deferred`; run the full preflight on the archive |
| `XCLOOM-SIGN-KEYCHAIN-UNIMPORTED` on `build --platform ios` / `archive` / `ota` | No store credentials for `DEVELOPMENT_TEAM`, and the macOS Keychain holds an identity that can sign for the target platform but is not imported (note: local interactive `run`/`dev --device physical` falls back automatically to Keychain `/usr/bin/codesign`) | Run `xcloom sign import-keychain --team-id <TEAM_ID>` interactively (or `xcloom sign list-keychain --json` to inspect) |
| Hot patch skips `dlopen` (`0` rebound) or returns `requires_full_rebuild: true` | Stored property added/reordered on `struct`/`class`/`actor` or `.swift` files deleted (newly added `.swift` files hot-patch automatically, and the redraw keeps `@State`) | Run a full `xcloom build --local` (`xcloom dev --watch` triggers `FullRebuildAndReplay`) |
| `DUO_HINGE_CREASE_OCCLUSION` / `DUO_LETTERBOX_FIXED_WIDTH` | Control straddles `24pt` fold crease or view hardcodes `375/393pt` on `951×669pt` `iPhone Duo` | Lay out with `GeometryProxy.reservedRegions(kind: .division)`, `NavigationSplitView`, and `.tabViewStyle(.sidebarAdaptable)` instead of fixed widths |
| `xcloom matrix` exits `1` with `matrix_layout_errors` | A cell has an `error` finding (`VIEWPORT_OVERFLOW`); warnings such as `CONTROL_OVERLAPS_TEXT` or `TEXT_TRUNCATION` do not fail the run | Open `cell-<id>.png` and `manifest.json` in the `--out` directory and fix the reported view |
| E2EE hot patch fails decompression | Zlib `0x78` header sent instead of raw RFC 1951 deflate (`COMPRESSION_ZLIB`) | Push via `xcloom tunnel push-dylib` or `EdgeTunnelHostClient` |
| `no device receipt for seq N` | App not running / agent not started / not paired, or it crashed loading the patch | Read the delivery state in the error; check `XCLoomHotAgent.shared.tunnelStatus`; relaunch via `xcloom dev --device tunnel` |
| `device rejected payload seq N ...: stale_sequence` or `stale_generation` | The device already applied a newer patch in this room (an older envelope arrived late, or the same `generation` was sent twice) | Push again with a higher `generation`; a new host session uses a new room |
| `switch_gear_refused` | `switch_branch` carried no `switch_gear`, or one other than `in_process_dylib`, `module_shadow`, `incremental_ota` | Send the gear from `xcloom branch classify --json` with the switch |
| `relay room ... is gone (edge_room_gone ...)` or agent status `failed: ... edge_room_gone` | The relay deleted the room (lifetime or idle limit) before it was rotated | Start a new room (`xcloom tunnel start` / `xcloom dev --device tunnel`) and pair the device again |
| Agent status `failed: ... 409` | Room already paired with another device key | Create a new room (`xcloom dev --device tunnel` without `--room-id`) and pair again |
| Idle simulators exhausting host RAM | Crashed test run left an XCLoom-booted simulator running | `xcloom sim status` (read-only fleet RAM, slim/stock mode, owner agent, and orphan TUI), then `xcloom sim lease --reap-once --json` (shuts down only simulators XCLoom booted) |
| `sim lease` says a matching simulator is "already booted outside XCLoom leases" | Another project booted it | Use a shut-down simulator, or `--adopt` to share it (XCLoom will not shut it down) |
| `xcloom: warning: ... GiB free on the volume holding the XCLoom cache` / `No space left on device` | Derived data of several projects filled the boot volume | `xcloom disk prune --safe --apply`; move caches with `XCLOOM_CACHE_DIR=<dir on a larger volume>` |
| `crash latest` returns a system daemon or the wrong app | Unfiltered `latest` before app-only selection, or another app crashed later | `xcloom crash latest --bundle-id <id>`; `xcloom crash list` shows everything |
## Reference Guides
- **Builds, Remote L2 CAS, CI, Skill, and Differential Verify**: [references/build-and-cluster.md](references/build-and-cluster.md)
- **Canvas DAG, Hot-Reload, UI Automation, X-Ray, and Crashes**: [references/canvas-and-hot-reload.md](references/canvas-and-hot-reload.md)
- **Side-by-Side `.dev` Off-LAN OTA and Cloudflare E2EE Reverse Tunnel**: [references/ota-and-cloudflare-tunnel.md](references/ota-and-cloudflare-tunnel.md)
- **Toolchains, `Assets.car`, and Linux Notes**: [references/linux-cross-and-toolchains.md](references/linux-cross-and-toolchains.md)
- **Signing, `ITMS-*` / Guideline `2.5.2` Preflight, ASC, and 37 MCP Schemas**: [references/signing-preflight-and-asc.md](references/signing-preflight-and-asc.md)
- **Companion Skill (`xcloom-appstore-review`)**: [../xcloom-appstore-review/SKILL.md](../xcloom-appstore-review/SKILL.md) (pre-submission binary, runtime, and Apple App Review Guideline audit; installed alongside `xcloom` by `xcloom skill install`)
- **Companion Skill (`xcloom-ui-qa`)**: [../xcloom-ui-qa/SKILL.md](../xcloom-ui-qa/SKILL.md) (evidence-driven UI/UX review pairing `matrix`, `diff-ui`, `feel`, and Agent-driven `ux session` with visual and flow judgment)
- **Companion Skill (`xcloom-binary-audit`)**: [../xcloom-binary-audit/SKILL.md](../xcloom-binary-audit/SKILL.md) (size, dead-code, `Assets.car`, and startup-order audit pairing `xray`, `order-profile`, and `verify diff-ipa` with source verification)