/ 目录 / 演练场 / ios-simulator-skill
● 社区 conorluddy ⚡ 即开即用

ios-simulator-skill

作者 conorluddy · conorluddy/ios-simulator-skill

22 个优化脚本封装 xcodebuild + iOS 模拟器——Claude 通过无障碍 API 而非像素坐标来构建、运行和交互应用。

为 iOS 开发工作流设计的生产级 Claude Code 技能。它用渐进式错误披露包装 xcodebuild(构建摘要的 Token 减少 95%+),并通过 iOS 无障碍 API 驱动模拟器,使交互对 UI 变化更稳健。包含设备生命周期管理、截图压缩、日志尾部跟踪和 WCAG 检查。

为什么要用

核心特性

实时演示

实际使用效果

ios-simulator-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "ios-simulator-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/conorluddy/ios-simulator-skill",
        "~/.claude/skills/ios-simulator-skill"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "ios-simulator-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/conorluddy/ios-simulator-skill",
        "~/.claude/skills/ios-simulator-skill"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "ios-simulator-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/conorluddy/ios-simulator-skill",
        "~/.claude/skills/ios-simulator-skill"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "ios-simulator-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/conorluddy/ios-simulator-skill",
        "~/.claude/skills/ios-simulator-skill"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "ios-simulator-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/conorluddy/ios-simulator-skill",
        "~/.claude/skills/ios-simulator-skill"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "ios-simulator-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/conorluddy/ios-simulator-skill",
          "~/.claude/skills/ios-simulator-skill"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add ios-simulator-skill -- git clone https://github.com/conorluddy/ios-simulator-skill ~/.claude/skills/ios-simulator-skill

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: ios-simulator-skill

构建、运行并截图当前流程

👤 使用 Claude Code 迭代的 iOS 开发者 ⏱ ~5 min beginner

何时使用: 修改了视图,想在不离开聊天的情况下看到实时效果。

前置条件
  • Xcode + 模拟器已安装 — 标准 macOS iOS 开发设置
步骤
  1. 要求 Claude 构建并运行
    使用 ios-simulator-skill。为 iPhone 16 构建 MyApp 方案,启动,导航到设置,截图。✓ 已复制
    → 简洁的构建摘要,然后是截图
  2. 迭代
    我调整了填充——重新构建并重新截图。✓ 已复制
    → 快速响应,最小的 Token 开销

结果: Claude Code 中紧凑的构建-迭代-查看循环。

注意事项
  • 方案名称拼写错误导致错误信息不清晰 — 方案不匹配时,技能返回可用方案的简洁列表
搭配使用: filesystem

驱动脚本化 UI 流程进行冒烟测试

👤 iOS 开发者和 QA ⏱ ~15 min intermediate

何时使用: 想验证关键流程,而不需要编写完整的 XCUITest 框架代码。

步骤
  1. 描述流程
    启动应用,点击'登录',输入凭证,点击列表中的第一行,截图。✓ 已复制
    → Claude 使用无障碍标签驱动每一步
  2. 检查 WCAG 合规性
    现在对当前屏幕运行无障碍审计。✓ 已复制
    → WCAG 发现及修复建议

结果: 一个有效的冒烟流程加上无障碍检查通过。

注意事项
  • 当标签更改时流程中断 — 标签比坐标更稳定,但大型 UI 重构后仍需审查

重现 bug 时尾部跟踪日志

👤 追踪不稳定问题的 iOS 开发者 ⏱ ~10 min intermediate

何时使用: bug 仅在模拟器中可复现,且你想要相关日志。

步骤
  1. 使用过滤日志复现
    启动应用,点击导致崩溃的流程,尾部跟踪过滤为错误+警告的日志。✓ 已复制
    → Claude 返回修剪后的日志包并突出显示可能的原因

结果: 目标日志摘录和 bug 的假设。

注意事项
  • 如果未设置严重性过滤器,日志过于嘈杂 — 默认为错误+警告;仅在调试时升级到信息级别

组合

与其他 MCP 搭配,撬动十倍杠杆

ios-simulator-skill + filesystem

技能运行构建;文件系统读/写源代码

编辑 SettingsView.swift,然后构建并截图。✓ 已复制
ios-simulator-skill + github

从 GitHub bug 报告在模拟器中复现问题

阅读问题 #42,在模拟器中复现步骤,将截图附加到评论。✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
xcodebuild wrapper scheme, destination 任何构建请求 0
Simulator driver (accessibility APIs) element label/role + action 模拟器中的 UI 自动化 0
Screenshot capture none (current screen) 视觉验证 0
Log tailing severity filter, duration 调试运行时问题 0
Device lifecycle boot/shutdown/create/reset 需要新的模拟器状态 0
Accessibility audit current screen 无障碍审查 0

成本与限制

运行它的成本

API 配额
每次调用 Token 数
非常低——简洁构建摘要 + 压缩截图是主要设计目标
费用
免费——技能是本地的
提示
保持截图默认压缩;全分辨率截图会快速消耗 context。

安全

权限、密钥、影响范围

凭据存储: 技能中没有凭证。应用端密钥保留在你的构建配置中。
数据出站: 无——一切都在本地模拟器上运行

故障排查

常见错误与修复

'No such scheme'

方案不匹配时,技能列出可用方案;选择确切的名称。

验证: xcodebuild -list -project MyApp.xcodeproj
Accessibility label not found

向 SwiftUI 视图添加 accessibilityIdentifier——它比可见标签更稳定。

Simulator stuck booting

使用设备生命周期重置命令;然后重新启动。

验证: xcrun simctl list

替代方案

ios-simulator-skill 对比其他方案

替代方案何时用它替代权衡
Direct xcodebuild + simctl你不介意原始输出的 Token 膨胀无抽象;冗长
XcodeBuildMCP你更喜欢带有结构化工具的 MCP 服务器MCP 路由;此技能是本地脚本

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills