/plugin marketplace add conorluddy/xclaude-plugin
模块化iOS开发自动化工具
通过与Claude进行自然对话来构建、测试和自动化iOS应用程序。8个特定工作流的MCP服务器,涵盖Xcode、模拟器和IDB的24种工具。
仅启用你需要的功能。 每个MCP都是为特定的工作流程设计的,保持上下文窗口简洁。此外,我们的工具智能封装了Xcode输出(错误、测试结果、构建日志),使得Claude处理结构化的JSON而不是原始的50多行日志——节省了大量的令牌,并加快了反馈循环。
/plugin marketplace add conorluddy/xclaude-plugin
/plugin install xclaude-plugin
/plugin marketplace add /path/to/xclaude-plugin
/plugin install xclaude-plugin
刚刚安装?启用xc-build和xc-launch以实现快速开发:
1. 在Claude设置中启用“xc-build”和“xc-launch”MCPs
2. 向Claude询问:“在iPhone 15上构建并运行MyApp”
3. 完成!✨
就是这样。xc-build + xc-launch提供了可组合的开发循环:使用xc-build构建,然后使用xc-launch安装和启动。Claude协调两步工作流程。如果你需要其他工作流程(测试、设置、UI自动化),请参阅下面的选择正确的MCP。
如果您正在从早期版本升级,请注意这些重大更改:
xc-build-and-launch → xc-launch发生了什么变化:
xcode_build_and_launch单体工具(带skip_build标志),以及xcode_build、xcode_clean、xcode_list(移动到xc-build)simulator_install_app和simulator_launch_app为什么: 单体xcode_build_and_launch工具将构建、安装和启动耦合为一个操作。新的架构将构建问题(xc-build)与模拟器生命周期(xc-launch)分开,实现了:
skip_build代码异味所需操作:
.mcp.json配置:
- "xc-build-and-launch": {
- "command": "node",
- "args": ["${CLAUDE_PLUGIN_ROOT}/mcp-servers/xc-build-and-launch/dist/index.js"]
+ "xc-launch": {
+ "command": "node",
+ "args": ["${CLAUDE_PLUGIN_ROOT}/mcp-servers/xc-launch/dist/index.js"]
先前版本:
v0.3.0:xc-run → xc-build-and-launchv0.3.0:xc-compile → xc-build,xc-hybrid → xc-all查看.mcp.json.example获取当前配置。
重要提示:为了优化令牌效率,每次只启用一个MCP。根据您的当前工作流程选择:
☐ xc-build # 构建验证、错误、清理?(~600令牌)
☐ xc-launch # 模拟器生命周期:安装 + 启动?(~400令牌)
☐ xc-interact # 测试UI,应用已经构建?(~900令牌)
☐ xc-ai-assist # AI驱动的UI迭代?(~1400令牌)
☐ xc-setup # 初次设置?(~800令牌)
☐ xc-testing # 运行测试套件?(~1200令牌)
☐ xc-meta # 维护任务?(~700令牌)
☐ xc-all # 复杂工作流程需要所有工具?(~3500令牌)
💡 提示:启用xc-build + xc-launch一起进行开发循环(~1000令牌总计)
场景1:构建并修复错误
启用:xc-build (~600令牌)
"构建项目并显示错误"
→ 使用xcode_build自动提取错误
→ 返回最多10个错误以便快速修复
→ 比旧架构少87%的令牌!
场景2:快速开发 - 构建并运行
启用:xc-build + xc-launch (~1000令牌)
"构建并运行MyApp在iPhone 15上"
→ Claude协调:构建(xc-build)→ 安装 & 启动(xc-launch)
→ 可组合的两步工作流程
→ 更好的错误恢复(重试单独步骤)
→ 适合迭代开发
场景3:测试UI流程(应用已经构建)
启用:xc-interact (~900令牌)
"点击登录按钮,然后检查是否出现个人资料屏幕"
→ 查询可访问性树(比截图快3-4倍)
→ 通过坐标点击元素
→ 不重新构建的情况下验证UI状态
场景4:AI驱动的UI迭代
启用:xc-ai-assist (~1400令牌)
"更新按钮颜色为蓝色,重新构建,并给我一张截图"
→ 修改代码,构建,捕获截图
→ 在一个MCP中完成整个工作流程
→ 包括视觉反馈(截图)
┌─────────────────────────────────────────────────────┐
│ 共享工具库 (24种工具) │
│ ├─ Xcode (6): 构建、构建+运行、清理、测试、列出、版本 │
│ ├─ 模拟器 (12): 启动、安装、截图等 │
│ └─ IDB (6): 描述、点击、输入、手势等 │
└─────────────────────────────────────────────────────┘
↓ 工具被MCP服务器导入 ↓
┌─────────────────────────────────────────────────────┐
│ 8种特定工作流的MCP服务器 │
│ ├─ xc-build: 3种工具 (~600令牌) │
│ ├─ xc-launch: 2种工具 (~400令牌) │
│ ├─ xc-interact: 6种工具 (~900令牌) │
│ ├─ xc-ai-assist: 7种工具 (~1400令牌) │
│ ├─ xc-setup: 5种工具 (~800令牌) │
│ ├─ xc-testing: 6种工具 (~1200令牌) │
│ ├─ xc-meta: 6种工具 (~700令牌) │
│ └─ xc-all: 24种工具 (~3500令牌) │
└─────────────────────────────────────────────────────┘
对于用户:
对于开发者:
any使用)| MCP | 工具 | 令牌成本 | 何时使用 |
|---|---|---|---|
| xc-build | 3 | ~600 | 构建验证,包括清理/方案发现 |
| xc-launch | 2 | ~400 | 模拟器生命周期:安装和启动应用 |
| xc-interact | 6 | ~900 | 测试UI流程,应用已经构建 |
| MCP | 工具 | 令牌成本 | 何时使用 |
|---|---|---|---|
| xc-ai-assist | 7 | ~1400 | AI UI迭代,带有视觉反馈 |
| xc-setup | 5 | ~800 | 初始设置,环境验证 |
| xc-testing | 6 | ~1200 | 运行测试套件 + UI自动化 |
| xc-meta | 6 | ~700 | 维护,管理,环境检查 |
| MCP | 工具 | 令牌成本 | 何时使用 |
|---|---|---|---|
| xc-all | 23 | ~3500 | 复杂工作流程需要所有工具 |
小贴士:不要同时启用多个MCP - 工具重复会增加令牌使用!对于多工作流程会话,请使用xc-all。
快速查找您需要的工具所在的MCP:
| 工具 | xc-build | xc-launch | xc-interact | xc-ai-assist | xc-setup | xc-testing | xc-meta | xc-all |
|---|---|---|---|---|---|---|---|---|
xcode_build | ✅ | ✅ | ✅ | |||||
xcode_build_and_launch | ✅ | |||||||
xcode_clean | ✅ | ✅ | ✅ | |||||
xcode_test | ✅ | ✅ | ||||||
xcode_list | ✅ | ✅ | ✅ | |||||
xcode_version | ✅ | ✅ | ✅ |
| 工具 | xc-build | xc-launch | xc-interact | xc-ai-assist | xc-setup | xc-testing | xc-meta | xc-all |
|---|---|---|---|---|---|---|---|---|
simulator_list | ✅ | ✅ | ||||||
simulator_boot | ✅ | ✅ | ||||||
simulator_shutdown | ✅ | ✅ | ||||||
simulator_create | ✅ | ✅ | ||||||
simulator_delete | ✅ | ✅ | ||||||
simulator_install_app | ✅ | ✅ | ||||||
simulator_launch_app | ✅ | ✅ | ||||||
simulator_terminate_app | ✅ | |||||||
simulator_screenshot | ✅ | ✅ | ✅ | |||||
simulator_openurl | ✅ | |||||||
simulator_get_app_container | ✅ | |||||||
simulator_health_check | ✅ | ✅ | ✅ |
| 工具 | xc-build | xc-launch | xc-interact | xc-ai-assist | xc-setup | xc-testing | xc-meta | xc-all |
|---|---|---|---|---|---|---|---|---|
idb_describe | ✅ | ✅ | ✅ | ✅ | ||||
idb_tap | ✅ | ✅ | ✅ | ✅ | ||||
idb_input | ✅ | ✅ | ✅ | ✅ | ||||
idb_gesture | ✅ | ✅ | ✅ | |||||
idb_find_element | ✅ | ✅ | ✅ | |||||
idb_check_quality | ✅ | ✅ | ✅ |
xcode_build - 构建并自动提取错误xcode_build_and_launch - 构建、安装并在模拟器上启动xcode_clean - 清理构建工件xcode_test - 运行XCTest套件xcode_list - 列出方案/目标xcode_version - 检查Xcode安装simulator_list - 枚举模拟器simulator_boot - 启动设备simulator_shutdown - 关闭设备simulator_create - 创建新模拟器simulator_delete - 删除模拟器simulator_install_app - 安装应用simulator_launch_app - 启动应用simulator_terminate_app - 终止应用simulator_screenshot - 捕获截图simulator_openurl - 打开URL/深层链接simulator_get_app_container - 获取应用容器路径simulator_health_check - 验证环境idb_describe - 查询可访问性树(以可访问性优先!)idb_tap - 点击坐标idb_input - 输入文本或按下按键idb_gesture - 滑动和硬件按钮idb_find_element - 按标签搜索(语义)idb_check_quality - 评估可访问性数据丰富程度在项目的.claude/CLAUDE.md文件中添加此部分。这指导Claude何时以及为何使用xclaude-plugin工具,而不是直接调用Xcode或shell命令:
## xclaude-plugin: 何时及为何使用这些工具
xclaude-plugin提供8个模块化MCPs和24种专门的iOS工具。**始终优先使用这些工具而不是原始的`xcodebuild`或shell命令**进行iOS开发任务。原因如下:
### 为什么这些工具优于原始命令
| 任务 | 直接Bash | xclaude-plugin | 为什么插件胜出 |
| -------------------- | -------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------- |
| 构建 + 获取错误 | `xcodebuild -scheme Foo 2>&1` (50多行解析) | `xcode_build` 工具 | 自动提取最多10个错误,结构化JSON,减少87%的令牌