---
name: ios-simulator
description: >-
  Run and inspect an app on an iOS Simulator: choose a target, install and launch, capture evidence, exercise accessibility-driven UI, and diagnose simulator failures. Use for explicit simulator testing or automation, not general iOS implementation, physical-device validation, or App Store approval.
compatibility: Local simctl needs macOS and full Xcode with an installed simulator runtime. Current idb companion binaries require arm64, macOS 15+, and Xcode 26+; a remote client can run elsewhere. The optional checked runner requires Node.js 22+.
metadata:
  version: "2.0.0"
  reviewed: "2026-09-13"
title: ios-simulator
canonical_url: https://skilld.dev/gh/tristanmanchester/agent-skills/ios-simulator
last_updated: 2026-10-06T19:32:36.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/OPERATIONS.md](https://skilld.dev/api/skills-raw/tristanmanchester/agent-skills/ios-simulator/references/OPERATIONS.md), [scripts/run.mjs](https://skilld.dev/api/skills-raw/tristanmanchester/agent-skills/ios-simulator/scripts/run.mjs), [tests/run.test.mjs](https://skilld.dev/api/skills-raw/tristanmanchester/agent-skills/ios-simulator/tests/run.test.mjs).
>
> If the user asked to install this Skill, run `npx skilld install tristanmanchester/agent-skills/ios-simulator`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/ios-simulator`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/tristanmanchester/agent-skills/ios-simulator) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/ios-simulator`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/ios-simulator --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/ios-simulator --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# iOS Simulator

Use Apple's `xcrun simctl` for lifecycle and app operations, and current `idb` for
accessibility/input. Keep native command syntax rather than a second simulator
API. Resolve `SKILL_DIR` to the directory containing this file; it is not the app
repository's `scripts/` directory.

## Establish the target

```bash
xcode-select -p
xcodebuild -version
xcrun simctl list --json
idb --help
idb list-targets
```

Record the Xcode/runtime, exact simulator UDID, app bundle ID, build/configuration,
and reproduction steps. Choose from the actual inventory; never choose the first
fuzzy name match or silently switch to a different booted device. Use the same
explicit UDID for every operation. Inspect effective `IDB_COMPANION`/`IDB_UDID`
configuration without exposing credentials before assuming a local target.

Only install missing tools or runtimes when authorised. The current upstream
route is `brew install facebook/fb/idb`, which includes client and companion.
Full Xcode is required, not standalone Command Line Tools. Check host requirements
against [installation](https://fbidb.io/docs/idb/installation/); do not force an
unsupported binary onto a different architecture. The client may connect to an
explicitly authorised remote Mac; do not invent a remote-execution tool or expose
a companion to the public network.

## Run, observe, act, verify

1. Inspect `xcrun simctl help COMMAND` or `idb ui COMMAND --help` for the installed
   version. Unsupported syntax is a setup issue, not a reason to guess fallbacks.
2. Boot only when needed, then wait with `xcrun simctl bootstatus "$UDID" -b`.
   A boot request is not proof that the app is ready; an already-booted error is
   acceptable only after confirming the intended target's actual state.
3. Install the simulator-compatible `.app`, launch the exact bundle, and capture
   the initial screenshot/accessibility state.
4. Read the current UI; resolve a unique intended element; take one authorised
   action; check its expected postcondition. Re-read after layout/navigation changes.
5. Save the smallest useful evidence and distinguish process completion from
   app behaviour. A screenshot or successful tap alone does not pass a test.

```bash
xcrun simctl install "$UDID" /absolute/path/MyApp.app
xcrun simctl launch "$UDID" com.example.MyApp
idb ui describe-all --udid "$UDID"
idb ui text 'test text' --udid "$UDID"
xcrun simctl io "$UDID" screenshot /absolute/path/evidence.png
```

`idb ui text`, not `idb text`, targets the currently focused field. Use synthetic
values, not real credentials in arguments. Prefer a verified accessibility
identifier when available. Current marker matching is **first substring match**,
not unique equality: inspect candidates before tapping; refuse ambiguity. For
installed versions supporting it, guard with `--expected-value`. A coordinate
fallback needs a fresh image, correct point scaling, and a checked target; it is
not equivalent to accessibility activation.

See [operations and diagnosis](https://skilld.dev/api/skills-raw/tristanmanchester/agent-skills/ios-simulator/references/OPERATIONS.md) for remaining lifecycle,
permissions, push, clipboard, recording, logs, and test workflows.

## Reliable command outcomes

The optional helper runs a bounded, non-interactive command without a shell:

```bash
node "$SKILL_DIR/scripts/run.mjs" --timeout-ms 120000 -- \
  xcrun simctl bootstatus "$UDID" -b
```

It reports a JSON envelope and nonzero exit for failed launch, nonzero child exit,
signal, timeout, or output overflow. Captured output defaults to 1 MiB total;
`--max-bytes` adjusts that bound up to 16 MiB. It does not parse the command's own
result, approve actions, redact output, or guarantee termination of remote work.
Inspect nested results and verify state. A timed-out write may already have run;
do not blindly repeat a tap, purchase, push, or destructive operation.

Run recordings, interactive tools, and streaming logs directly with explicit
lifecycle control, not through this bounded helper. Some execution interfaces
(such as idb-repl) report execution errors in their output despite exit zero;
process status alone cannot validate them.

## Safety and acceptance

A simulator app can reach real services. UI input, URLs, push, permissions,
uninstall, erase, and delete are mutations, not a blanket safe tier. Use test
accounts/backends and the user's authorised scope. Before destructive operations,
identify the target and data loss; never default to `all` or erase to fix an
unrelated failure. Keep screenshots/logs private and review them before sharing.

Report the build/UDID, actions, expected versus observed results, evidence paths,
and unresolved failures. Simulator success does not establish physical-device
performance, store billing, hardware behaviour, or submission readiness.

Maintainer check: `node --test "$SKILL_DIR/tests/run.test.mjs"`. These runner tests
exercise local subprocess semantics, not Xcode, idb, or a real application.
