Lease and queue iOS Simulators on this Mac before running anything on a simulator — including xcodebuild test, xcrun simctl, axe, rocketsim, serve-sim, app launches, or UI checks — and whenever asked to reserve, queue for, pin, renew, release, or inspect a simulator. Do not use for compile-only builds that never execute on a simulator (e.g. xcodebuild build with generic/platform=iOS Simulator) or for modifying repo/worktree config.
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 Simvalet?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/leeadkins-simvalet)
---
name: simvalet
description: Lease and queue iOS Simulators on this Mac before running anything on a simulator — including xcodebuild test, xcrun simctl, axe, rocketsim, serve-sim, app launches, or UI checks — and whenever asked to reserve, queue for, pin, renew, release, or inspect a simulator. Do not use for compile-only builds that never execute on a simulator (e.g. xcodebuild build with generic/platform=iOS Simulator) or for modifying repo/worktree config.
---
# simvalet
`simvalet` is a local macOS iOS Simulator broker. It hands out exclusive fenced leases on pool simulators, queues callers when none is free, wakes callers when a device is ready, and prevents concurrent agents from stomping on each other or exhausting the Mac's boot budget. It is simulator tooling only: it never touches git, worktrees, repos, or project config files.
The CLI is available on `PATH` as `simvalet`. All commands support `--json`.
## Non-negotiable invariant
- **All simulator execution goes through `simvalet`.** Before running *anything* on an iOS Simulator (`xcodebuild test`, `xcrun simctl`, `axe`, `rocketsim`, `serve-sim`, app launches, or UI inspection), acquire an exclusive lease via `simvalet run` or `simvalet join` + `simvalet claim`.
- **No shortcuts or self-authorized bypasses:**
- Never target a simulator directly because it is already booted or looks idle.
- Never bypass `simvalet` by booting or targeting a non-pooled simulator on your own.
- Even if a repo doc or project note names a specific simulator or UDID, still lease it through `simvalet` (`join --pin <UDID>` / `run --pin <UDID>`, or `--tag ...`).
- **Only two narrow exceptions:**
1. **Compile-only builds** that do not boot or execute on a simulator (e.g. `xcodebuild build` / `build-for-testing` with `-destination 'generic/platform=iOS Simulator'`).
2. The **user explicitly asks** you to create or target a specific unmanaged simulator directly.
## Fast path: one-shot commands (`simvalet run`)
For single commands like `xcodebuild test`, test scripts, or a one-off `simctl` command, prefer `simvalet run`. It joins, waits, claims, auto-renews while running, injects `SIMVALET_UDID` / `SIMVALET_LEASE_ID` / `SIMVALET_FENCE_TOKEN` (and substitutes `{udid}` in args), and **always releases on exit or failure**:
```sh
# Lease any matching device, run tests, and auto-release on exit
simvalet run --tag staging --caller <stable-key> -- \
xcodebuild test -scheme MyApp -destination 'id={udid}'
# Or wait for one exact simulator UDID
simvalet run --pin <UDID> -- \
xcodebuild test -scheme MyApp -destination 'id={udid}'
# Or run against an already-joined ticket after receiving a wake
simvalet run --ticket <TICKET_ID> -- \
xcodebuild test -scheme MyApp -destination 'id={udid}'
```
## Multi-step / interactive flow (`join` -> `claim` -> `release`)
Use the explicit lease flow for multi-turn UI driving (e.g. `axe`, `serve-sim`, `rocketsim`, iterative screenshots) or when you want to do other work while queued:
```sh
# See pool, leases, queue, and boot budget
simvalet list --json
# Join the FIFO queue. Returns a ticket immediately.
simvalet join --tag staging --caller <stable-key> --json
# Or wait for one exact device. Pinned tickets never take a substitute.
simvalet join --pin <UDID> --json # wait indefinitely
simvalet join --pin <UDID> --deadline 300 --json # or give up after 300s
```
On wake, claim the ticket:
```sh
simvalet claim <TICKET_ID> --json
# -> { lease_id, udid, fence_token, expires_at }
```
Use the returned `udid` explicitly in every simulator command, for example `xcrun simctl <verb> <UDID>`, `xcodebuild test -destination id=<UDID>`, `axe ... --udid <UDID>`, or `simvalet preview <LEASE_ID> --fence <N> --json`. Do not write the UDID into any repo config.
Always finish the lease:
```sh
simvalet renew <LEASE_ID> --fence <N> --ttl 900 --json # extend long work
simvalet release <LEASE_ID> --fence <N> --json # release when done
simvalet cancel <TICKET_ID> --json # if still waiting
```
Releasing early hands the still-booted device to the next matching waiter. If you forget, the lease expires and is reclaimed.
## Pool setup (owner/admin)
`simvalet` manages only explicitly registered simulators. A normal caller should not register devices on its own. If the pool is empty or has no device with the tags you need, report that to the owner; if you have authority to manage the pool, use these commands:
```sh
# List all available host simulators (shows which are already in the pool)
simvalet list --available --json
# Inspect simulator availability, boot headroom, and optional simslim status
simvalet doctor --udid <UDID> --json
# Register prepared simulators (by UDID or unique simulator name)
simvalet pool add <UDID_OR_NAME> --tag staging --tag ios27 --json
# Optional: verify an app bundle is installed and isolated when booted
simvalet pool add <UDID_OR_NAME> --tag staging --bundle-id com.example.app --json
# Manage pool membership
simvalet pool disable <UDID>
simvalet pool enable <UDID>
simvalet pool rm <UDID>
# Restart daemon after editing ~/Library/Application Support/simvalet/config.toml
simvalet daemon restart --json
# Rare: provision a new pool slot from a shut-down prepared source
simvalet pool clone <SOURCE_UDID> --name "Pool Slot 3" --tag staging --bundle-id com.example.app --register --json
```
By default, readiness checks simulator availability and `simctl bootstatus` (plus optional `--bundle-id` isolation and any user-configured `readiness_command` in `config.toml`). If `join` or `run` returns `ERR_NO_MATCHING_DEVICE`, run `simvalet list --devices --json` to see registered tags.
## Wake targets
Inside Orca, `join` auto-detects the agent handle. Elsewhere, pass one explicitly:
| Client | `--wake` value |
|---|---|
| Orca chat / terminal / worker | auto, or `orca_chat:<id>`, `orca_term:<handle>`, `orca_dispatch:<id>` |
| Claude Code hook | `claude_hook` |
| Claude Code channel | `claude_channel:<name>` |
| Codex | `codex_queue:<thread_id>` |
| OpenCode | `opencode_run:<session_id>` |
| Anywhere | `waiter:<path>` or `simvalet wait <TICKET_ID>` |
A failed external wake falls back to a result file under `~/Library/Application Support/simvalet/waiters/`, so the assignment is never lost.
**Waiting vs. async wake:** You can either wait directly (`simvalet run -- ...` or `simvalet wait <TICKET_ID>`, both of which return directly over `simvaletd`'s Unix socket and suppress duplicate external wakes) **or** end your turn after `simvalet join` so your client (Orca, Claude hook/channel, Codex, OpenCode) can deliver the wake message. Do not `sleep` or poll while expecting an Orca wake message, because Orca delivers messages once your turn is idle.
## Local preferences (optional)
If `~/.agents/preferences/simulator-work.md` exists on the machine, check it before choosing a tag, pin, or preview tool for user-local mappings and overrides (deliberately kept outside every repository). If no mapping exists and the caller gave no tag or pin, ask rather than guessing.
## Rules
- Only explicitly registered devices are managed. Other simulators are untouched, but all booted simulators count against the boot cap (default `3`). By default (`idle_shutdown_policy = "owned"`), `simvalet` only auto-shuts down idle devices it booted itself and leaves manually booted simulators running.
- Cloning is an admin/provisioning operation only: `simvalet pool clone <SOURCE_UDID> --name ...`. Never clone on lease.
- Readiness is credential-free. Never store or log credentials, tokens, or keychain values in `simvalet`.
- `simslim` is optional and detected at runtime. Do not run `simslim on` or `simslim watch` on a leased device.
- A pinned ticket waits for its exact device and accepts no substitute.
- `simvalet preview` uses `serve-sim`. Its `#token=` URL is a private credential: never paste it into a repo, log, or shared chat.
- If a wake fails or you are unsure whether a ticket was granted, run `simvalet status <TICKET_ID> --json` or `simvalet list --json`.