ios-build
Build ${APP_NAME} for a simulator or a connected iPhone via build.sh. Use when the user asks to build, compile, run, or install the iOS app — including phrasings like "build for sim", "build on my phone", "ship it to the device", or just "build". Encodes the project's signing/profile-detection rules so generated commands don't drift back to assumptions about Xcode paths or keychain certs.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- ios-build
- description
- Build ${APP_NAME} for a simulator or a connected iPhone via build.sh. Use when the user asks to build, compile, run, or install the iOS app — including phrasings like "build for sim", "build on my phone", "ship it to the device", or just "build". Encodes the project's signing/profile-detection rules so generated commands don't drift back to assumptions about Xcode paths or keychain certs.
02 资源文件 1
- 脚本scripts/build.sh991 B
03 SKILL.md 正文
iOS Build
Requires .claude/app.yml in the app repo root with app.scheme, app.bundle_id, optionally app.build_script (default build.sh). The build wrapper sources skills/_lib/load_app_config.sh.
Run the project's ./build.sh rather than constructing xcodebuild invocations from scratch — the script already handles xcodegen regeneration, device UDID detection, provisioning-profile-based team ID resolution, and devicectl install.
Mode selection
| User intent | Command |
|---|---|
| Default / "build" / "build for sim" | ./build.sh (iPhone 15 Pro Max) |
| Specific simulator | ./build.sh -s "iPhone 16 Pro" |
| Real device (connected iPhone) | ./build.sh -d |
| Inspect what would happen without building | ./build.sh -d --debug |
Fallback: the bundled wrapper
This skill also bundles scripts/build.sh. It is not the app's ./build.sh
and does less:
- Takes only
sim(default) ordevice; anything else exits 2. It forwards no other flags, so there is no-s <simulator>and no--debug. - If the app's own
./${APP_BUILD_SCRIPT}is executable it justexecs it (devicebecomes-d); otherwise it runs barexcodebuild. - The bare path hard-codes
name=iPhone 16forsim, andgeneric/platform=iOSwithDEVELOPMENT_TEAM="${APP_TEAM_ID}"and-allowProvisioningUpdatesfordevice. - The bare path does no xcodegen regeneration, no provisioning-profile team
detection, and no install — a
devicerun builds but never installs on the phone.
Prefer the app's ./build.sh (table above) whenever it exists.
Hard rules — do NOT regress these
These are house rules earned through past debugging. Violating them will reintroduce specific bugs we've already fixed:
-
Xcode 16+ provisioning profiles live at
~/Library/Developer/Xcode/UserData/Provisioning Profiles/. Older path~/Library/MobileDevice/Provisioning Profiles/may not exist on fresh installs. Always check both. -
Resolve team ID from a provisioning profile, not from the keychain.
security find-identitymay return a stale cert from a prior Apple ID. ReadTeamIdentifierfrom the profile whoseEntitlements.application-identifiermatches<TEAM>.<bundle-id>. -
plutil -extractkeypaths are unquoted dotted names.'Entitlements.application-identifier'works;'Entitlements."application-identifier"'silently fails with no value. -
set -euo pipefail+ grep/awk/sed = silent script death. Detection pipelines that legitimately may match nothing must end with|| true, or capture into a variable and check[[ -z … ]]. -
project.ymlvalues are unquoted YAML. Don't parse withawk -F'"'; useawk '{print $2}'or yq. (This skill assumes XcodeGen-style project.yml; adjust if your app uses an Xcode project directly.)
When the user reports a device-build failure
Do not start patching xcodebuild flags. Instead, run the failing command with tee to a log file, then:
-
Check whether the failure is profile-related ("No profiles for X were found", "No Account for Team Y") — if so, the bootstrap from Xcode UI hasn't completed yet. Tell the user to plug in iPhone, enable Developer Mode, select device in Xcode toolbar, and press ⌘R once. Do not try to fix this from CLI.
-
Check whether it's a detection bug in build.sh — if the script picked the wrong team ID or didn't find the profile, fix the detection logic in
build.sh, not the project file. -
Check whether it's a signing setup gap (missing cert) — the
.dev-teamfile is the gitignored escape hatch (legacy escape hatch; new apps drive team viaapp.yml app.team_idinstead).
When the user wants to rebuild after editing Swift files
xcodebuild is incremental by default — no need for clean builds. Only suggest rm -rf build ~/Library/Developer/Xcode/DerivedData/${APP_NAME}-* when the build genuinely produces stale results (e.g., after editing project.yml).
Output expectations
- Simulator builds finish in 5–60s and end with
** BUILD SUCCEEDED **. - Device builds end with
App installed: • installationURL: …. The "No provider was found" warning during install is benign for Personal Team. - Surface any new shellcheck or compiler warnings to the user; don't silence them.
04 同仓库更多 Skills
second-wind
Orchestrate long unattended Claude Code runs across multiple repos with the wind CLI. Use when the user wants to run Claude Code overnight, resume sessions after the 5-hour usage limit, run Claude in many repos at once via tmux, or says "set up second wind", "wind up", "overnight run", "resume after limit", "usage limit orchestrator".
structured-output-adaptive-thinking-token-bloat
A Claude API call using output_config.format (json_schema structured outputs) with thinking:{type:"adaptive"} burns most of its output budget on thinking (observed ~21k of ~24k tokens) without improving JSON quality, making the run up to ~5x more expensive than the same call with thinking omitted — use when calling the Messages API with a json_schema output format for extraction, ranking, classification, or summarization tasks, or when a schema-constrained call's usage.output_tokens is far larger than the returned JSON.
review
Apply a code-review lens to a diff, branch, or file — find correctness bugs, security issues, and quality problems, ranked by severity, with a concrete fix for each. Use when the user says "review this", "review my diff", "check this PR", "look this over before I commit", or "is this safe". Skip when the user wants the code written, not reviewed.
refresh
Rebuild the prompt-craft command registry and usage profile, and print a summary of installed commands and your personalized recommendations. Use when you install or update plugins and want the advisor to pick them up immediately, or say "refresh prompt-craft", "rebuild the command registry".
refactor
Apply a refactoring lens — restructure code without changing behavior, guarded by tests that pass before and after. Use when the user says "refactor", "clean this up", "extract this", "simplify this", "reduce duplication", or "make this readable" on existing working code. Skip when the change is meant to alter behavior (that's a feature or a fix).
plan
Decompose a non-trivial task into an explicit, tracked plan with goals and per-step acceptance criteria before writing code. Use when the user says "plan this", "break this down", "what's the plan", or asks for a multi-step feature/refactor that touches more than one file. Pairs with plan mode. Skip for single-edit changes that need no decomposition.