xc-dev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesexc-dev
xc-dev
xc-dev.xc-dev/project.toml.xc-dev/simulator.toml.xc-dev/tasks.tomlbuildruntesttest-package{{scheme}}{{bundle_id}}{{sim_id}}{{derived_data}}{{git_branch}}xc-dev.xc-dev/project.toml.xc-dev/simulator.toml.xc-dev/tasks.tomlbuildruntesttest-package{{scheme}}{{bundle_id}}{{sim_id}}{{derived_data}}{{git_branch}}When to use this skill
何时使用该工具
Activate when all of these are true:
- The user is doing iOS / Xcode work (build, run, test, install, launch, archive, log stream, clean DerivedData, etc.).
- The project has a directory anywhere up from cwd (run
.xc-dev/or walk up; an existingls -d .xc-dev 2>/dev/nullis the dispositive signal).tasks.toml
Do not use this skill — fall back to generic Xcode tooling — when:
- The project has no and the user isn't asking to set one up.
.xc-dev/
当所有以下条件都满足时启用:
- 用户正在进行iOS/Xcode相关工作(构建、运行、测试、安装、启动、归档、日志流、清理DerivedData等)。
- 项目中从当前工作目录向上的任意位置存在目录(可运行
.xc-dev/或向上遍历目录;若存在ls -d .xc-dev 2>/dev/null则是明确信号)。tasks.toml
请勿使用该工具——转而使用通用Xcode工具——当:
- 项目中没有目录,且用户未要求创建该目录时。
.xc-dev/
Discovery first
先进行发现操作
Before assuming task names, list them:
sh
xc-dev # bare form is shorthand for `xc-dev :list`
xc-dev :listFor variables (scheme, bundle id, sim id, derived data path, git branch, …):
sh
xc-dev :get scheme
xc-dev :get bundle_id
xc-dev :get sim_id
xc-dev :get derived_data
xc-dev :get sim.ipad.id # qualified, non-default sim
xc-dev :get git_branchTo sanity-check the config and every task's variable references:
sh
xc-dev :doctor在假设任务名称之前,先列出所有任务:
sh
xc-dev # 裸命令是`xc-dev :list`的简写
xc-dev :list查看变量(scheme、bundle id、sim id、DerivedData路径、git分支等):
sh
xc-dev :get scheme
xc-dev :get bundle_id
xc-dev :get sim_id
xc-dev :get derived_data
xc-dev :get sim.ipad.id # 指定非默认模拟器
xc-dev :get git_branch检查配置及所有任务的变量引用是否正常:
sh
xc-dev :doctorRunning tasks
运行任务
sh
xc-dev build
xc-dev build Release # positional override of `args = ["config=Debug"]`
xc-dev test-package Networking
xc-dev -v build # echo expanded command to stderr (handy for debugging)Exit codes:
- — success
0 - — task error (config invalid, command failed, variable unresolved, …)
1 - — CLI parse error (unknown built-in, missing flag value, …)
2
sh
xc-dev build
xc-dev build Release # 位置参数覆盖`args = ["config=Debug"]`配置
xc-dev test-package Networking
xc-dev -v build # 将展开后的命令输出到stderr(便于调试)退出码:
- —— 成功
0 - —— 任务错误(配置无效、命令执行失败、变量未解析等)
1 - —— CLI解析错误(未知内置命令、缺少标志值等)
2
When the task you need doesn't exist
当所需任务不存在时
Prefer adding a task to rather than constructing an
invocation yourself. Two reasons:
.xc-dev/tasks.tomlxcodebuild- The next person doing the same thing will benefit from the task being there.
- The variables are already wired up — ,
{{scheme}}, etc. all resolve correctly, so you don't have to re-derive them.{{derived_data}}
Show the user the proposed task and ask before editing.
优先向中添加任务,而非自行构造调用。原因有二:
.xc-dev/tasks.tomlxcodebuild- 后续执行相同操作的人会受益于已存在的任务。
- 变量已配置完成——、
{{scheme}}等均可正确解析,无需重新推导。{{derived_data}}
在编辑前,向用户展示拟添加的任务并征得同意。
Built-in verbs (cheat sheet)
内置命令速查表
| Verb | What |
|---|---|
| Scaffold |
| List all tasks with their |
| Print one variable |
| Sanity-check config + every task's vars + depends |
| Dry-run: list local + system DerivedData for this project |
| Delete them (Packages under the root included; skips |
| Resolve simulator UDIDs into |
| 命令 | 功能 |
|---|---|
| 快速搭建 |
| 列出所有任务及其 |
| 打印指定变量的值 |
| 检查配置、所有任务的变量及依赖是否正常 |
| 试运行:列出该项目的本地及系统DerivedData |
| 删除上述DerivedData(包含根目录下的Packages;跳过 |
| 将模拟器UDID解析到 |
Common patterns
常见使用模式
Boot + launch the default sim:
sh
xc-dev run # if the user has set up the example `run` task启动默认模拟器并运行应用:
sh
xc-dev run # 若用户已配置示例`run`任务else manually:
否则手动执行:
xcrun simctl boot $(xc-dev :get sim_id) 2>/dev/null || true
xcrun simctl install $(xc-dev :get sim_id) $(xc-dev :get app_path)
xcrun simctl launch $(xc-dev :get sim_id) $(xc-dev :get bundle_id)
**Inspect the app bundle that the build produced:**
```sh
ls "$(xc-dev :get app_path)"Per-worktree DerivedData:
{{derived_data}}{{xc_dev_dir}}/DerivedDataClean DerivedData (local + system):
Prefer the builtin — do not only local DerivedData or hand-scan
by folder name:
rm -rf~/Library/Developer/Xcode/DerivedDatash
xc-dev :clean # dry-run
xc-dev :clean --yes # delete local {{derived_data}} + system entries whose
# info.plist WorkspacePath is under this project root
# (main .xcodeproj and Packages/*)If the project has a task, prefer when it wraps
(and optionally ). Simulator deletion is not part of .
cleanxc-dev clean:cleansim-delete:cleanxcrun simctl boot $(xc-dev :get sim_id) 2>/dev/null || true
xcrun simctl install $(xc-dev :get sim_id) $(xc-dev :get app_path)
xcrun simctl launch $(xc-dev :get sim_id) $(xc-dev :get bundle_id)
**查看构建生成的应用包:**
```sh
ls "$(xc-dev :get app_path)"每个工作树独立的DerivedData:
{{derived_data}}{{xc_dev_dir}}/DerivedData清理DerivedData(本地+系统):
优先使用内置命令——不要仅通过删除本地DerivedData,或手动遍历文件夹:
rm -rf~/Library/Developer/Xcode/DerivedDatash
xc-dev :clean # 试运行
xc-dev :clean --yes # 删除本地{{derived_data}}及系统中info.plist的WorkspacePath位于该项目根目录下的条目
# (包含主.xcodeproj和Packages/*)若项目中有任务,当该任务封装了(可选包含)时,优先使用。模拟器删除不属于:clean的功能。
clean:cleansim-deletexc-dev cleanReference docs
参考文档
If you need more detail than this skill provides, point the user at:
- — full Task DSL reference
crates/xc-dev/docs/tasks.md - — every built-in variable + resolution order
crates/xc-dev/docs/variables.md - — TOML schemas
crates/xc-dev/docs/config.md - — example task recipes
crates/xc-dev/docs/examples.md
如果需要比本工具提供的更多细节,请引导用户查看:
- —— 完整的Task DSL参考文档
crates/xc-dev/docs/tasks.md - —— 所有内置变量及解析顺序
crates/xc-dev/docs/variables.md - —— TOML配置 schema
crates/xc-dev/docs/config.md - —— 任务示例
crates/xc-dev/docs/examples.md
Relationship to other skills
与其他工具的关系
- — reserved for UI automation, log streaming, and interactive debugging that xc-dev doesn't cover.
xcodebuildmcp-cli
- —— 用于xc-dev未覆盖的UI自动化、日志流及交互式调试场景。
xcodebuildmcp-cli