agentleFS
DebugSwiftDebugSwift/XcodeBazelMCP/.agents/skills/simulator-workflow/SKILL.md

simulator-workflow

Skill9 starsChanged 6 months agoMITView on GitHub

Build, run, and test iOS apps on simulators. Use when working on simulator build flows, app bundle discovery, simulator resolution, or boot/install/launch logic.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After bazel build, search bazel-bin/ using the target label's package path.

    line 25
  2. Very specific:

    Do not rely on the sim app writing directly to .cursor/debug-*.log on the host

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Simulator Workflow

Build + Run + Launch Chain

The bazel_ios_build_and_run tool chains these steps (each failure short-circuits):

  1. Build — bazel build <target>
  2. Find app — search bazel-bin/ using target label's package path
  3. Resolve simulator — priority: explicit UDID > name match > first booted > first available iPhone > first available device
  4. Boot — lazy, only simctl boot if state != Booted
  5. Install — simctl install <udid> <app_path>
  6. Read bundle ID — plutil -convert json -o - on Info.plist (sync execSync)
  7. Launch — simctl launch <udid> <bundleId>

App Bundle Discovery

  • After bazel build, search bazel-bin/ using the target label's package path.
  • Target //:Foo → bazel-bin/Foo.app, //Apps/Bar:Bar → bazel-bin/Apps/Bar/Bar.app.
  • rules_apple places bundles inside <target>_archive-root/Payload/ — findAppBundle searches recursively.

Simulator Resolution

resolveSimulator returns { device: SimulatorDevice; warning?: string }:

  • warning is set when the resolved simulator is not the explicitly requested one (fallback).
  • resolveSimulatorFromArgs in helpers.ts is the convenience wrapper — returns { sim, warning }.
  • prependWarning(message, warning) prepends the warning to tool output.

Launch Environment Variables

Env vars are passed via SIMCTL_CHILD_* prefix convention — simctl forwards them to the launched process.

For Cursor DEBUG MODE (NDJSON hypothesis logs), use the swift-agent-debug-log skill and bazel_ios_agent_debug_* tools:

  • AGENT_DEBUG_LOG_PATH / AGENT_DEBUG_SESSION_ID via launchEnv on build_and_run or agent_debug_repro
  • Simulator fallback: Documents/agent-debug.ndjson + bazel_ios_agent_debug_log_pull
  • Do not rely on the sim app writing directly to .cursor/debug-*.log on the host

Platform CPU Flags

PlatformFlag
iOS simulator--ios_multi_cpus=sim_arm64
iOS device--ios_multi_cpus=arm64
macOS(none — host arch)
tvOS--tvos_cpus=sim_arm64
watchOS--watchos_cpus=arm64
visionOS--visionos_cpus=sim_arm64

Platform Discovery Queries

Uses rules_apple rule names: ios_application, macos_application, tvos_application, watchos_application, visionos_application (and *_unit_test variants).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.