Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

xcode-dev-loop

БесплатноБез исполняемых скриптовНе проверен

WHEN building, testing, or visually verifying an Xcode project from the command line — xcodebuild runs, Swift Testing result reading, simulator…

mintuzот mintuz★ 38 звёзд на GitHub

Об этом скилле

Xcode Dev Loop

Discover, build in the background, read results, launch on a simulator, capture screens. This loop runs and inspects; it does not author Swift source or tests. Route Swift Testing authoring to swift-testing, XCTest UI automation to xcuitest, and existing non-UI XCTest unit/integration or measure tests to the project's established XCTest conventions with tdd. A dedicated reusable non-UI XCTest authoring guide remains a gap. Preserve the suite's framework rather than forcing a migration. Return here to execute and interpret the real result.

1. Discover Before You Guess

  • Find the container first: list the checkout for a .xcworkspace or .xcodeproj.
  • List the schemes of a workspace with xcodebuild -list -workspace <name>.xcworkspace.
  • List the targets, build configurations, and schemes of a project with xcodebuild -list -project <name>.xcodeproj (use this form when you need a target name).
  • Build and test with the container flag you listed with, and always name the scheme: xcodebuild test -workspace <name>.xcworkspace -scheme <Scheme>. The test action fails without a scheme.
  • List simulator UDIDs with xcrun simctl list devices available -j; resolve the UDID once, then reuse it.
  • Read installed simulator command options with xcrun simctl help <subcommand>.
  • Never address a simulator by name: duplicate names ("iPhone 17 Pro Max") cause "No booted simulator named …" failures. Only the listing output separates same-named devices, so give the listing command beside the UDID whenever you replace a name.
  • When a scheme needs a runtime the default Xcode lacks (e.g. a watchOS beta), export DEVELOPER_DIR=/Applications/Xcode-<version>.app/Contents/Developer for the whole session, so every xcodebuild and xcrun call selects the same Xcode.

2. Build and Test in the Background

  • Never let xcodebuild hold the foreground: a clean build or test run routinely exceeds the 600 s command timeout, and a command killed at the timeout leaves no verdict.

  • Start the run in the background, redirect its output to a log file in the scratchpad, and keep a handle whose exit status you can read later. Prefer the harness's background facility (Bash with run_in_background: true) and the task handle it returns.

  • With only a plain shell, make the run record its own exit status; a later shell cannot wait for another shell's child. Give every attempt its own log and status path; a stale status file ends the wait at once and reports the wrong result:

    ( xcodebuild ... > "$LOG" 2>&1; echo $? > "$LOG.status" ) &   # start it
    until [ -f "$LOG.status" ]; do sleep 5; done                  # wait, in a later call
    
  • Use CODE_SIGNING_ALLOWED=NO for simulator builds.

  • Pin the destination as platform=iOS Simulator,id=<udid>.

  • When one target or test matters, scope the run with -only-testing:<TestTarget>[/<Suite>/<test>]; preserve the log.

  • Never wait with a chained foreground sleep; the harness blocks it.

  • Wait on the kept handle with the harness's blocking wait (Monitor, or the task-output wait), or for the .status file with the loop above. Read the exit status first, then the log's terminal marker. Do not wait by grep alone: it keeps polling when xcodebuild exits before writing a marker.

3. Read Results Correctly (Swift Testing Is Not XCTest)

  • Swift Testing does NOT emit XCTest's Test Case ... passed lines.
  • Executed 0 tests, with 0 failures is the empty XCTest summary; it proves nothing.
  • Always pass -resultBundlePath with a new path per attempt; xcodebuild fails when the path already exists.
  • Read the verdict from that fresh bundle with xcrun xcresulttool get test-results summary --path <bundle>. A pass needs the expected non-zero test count there, no failure or crash there, ** TEST SUCCEEDED **, and a zero exit status (principle-prove-it-works).
  • The log's ✔ Test run with N tests in M suites passed, with N greater than zero, corroborates that count; a pattern that also matches zero proves nothing. A filtered or -quiet log can omit the line, so never treat its absence alone as the verdict.
  • Take the expected test count from the target's tests or test plan, never from the run you are judging.
  • Match the expected case IDs against xcresulttool get test-results tests --path <bundle>; totals alone do not prove each selected case ran. Inspect test-details and metrics when a case fails or measures performance, preserving the actual measurements and failure reason. Pin the toolchain, configuration, device and workload for comparisons. State the non-UI XCTest authoring-guide gap explicitly when using project conventions as the fallback.
  • A run that executed zero tests is not a pass, whatever its exit status (principle-gaps-are-not-passes). Suspect the selection before the code: confirm -only-testing still names the current suite and test after any rename
Полный SKILL.md на GitHub

Установить xcode-dev-loop в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/device-interaction.md

FAQ

Что делает скилл xcode-dev-loop?

WHEN building, testing, or visually verifying an Xcode project from the command line — xcodebuild runs, Swift Testing result reading, simulator install/launch, and screenshots; NOT for authoring Swift source or tests; returns the canonical build/test/inspect loop.

Как установить скилл xcode-dev-loop?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл xcode-dev-loop запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить xcode-dev-loop с