mobilebuildmcp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MobileBuildMCP

MobileBuildMCP

Use MobileBuildMCP tools instead of raw
xcodebuild
,
xcrun
, or
simctl
.
Capabilities:
  • Session defaults: Configure project, scheme, simulator, and device defaults to avoid repetitive parameters
  • Project discovery: Find Xcode projects/workspaces, list schemes, inspect build settings
  • Simulator workflows: Build, run, test, install, and launch apps on iOS simulators; manage simulator state (boot, erase, location, appearance)
  • Device workflows: Build, test, install, and launch apps on physical devices with code signing
  • macOS workflows: Build, run, and test macOS applications
  • Log capture: Stream and capture logs from simulators and devices
  • LLDB debugging: Attach debugger, set breakpoints, inspect stack traces and variables, execute LLDB commands
  • UI automation: Capture screenshots, inspect view hierarchy with coordinates, perform taps/swipes/gestures, type text, press hardware buttons
  • SwiftPM: Build, run, test, and manage Swift Package Manager projects
  • Project scaffolding: Generate new iOS/macOS project templates
Only simulator workflow tools are enabled by default. If capabilities like device, macOS, debugging, or UI automation are not available, the user must configure MobileBuildMCP to enable them. See https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/configuration.mdx for workflow configuration.
请使用 MobileBuildMCP 工具,而不是直接使用
xcodebuild
、
xcrun
或
simctl
。
能力:
  • 会话默认值:配置项目、scheme、模拟器和设备的默认值,避免重复传入参数
  • 项目发现:查找 Xcode 项目/工作区,列出 scheme,检查构建设置
  • 模拟器工作流:在 iOS 模拟器上构建、运行、测试、安装和启动应用;管理模拟器状态(启动、抹除、位置、外观)
  • 设备工作流:通过代码签名在物理设备上构建、测试、安装和启动应用
  • macOS 工作流:构建、运行和测试 macOS 应用
  • 日志采集:流式传输并采集模拟器和设备日志
  • LLDB 调试:附加调试器、设置断点、检查堆栈跟踪和变量、执行 LLDB 命令
  • UI 自动化:截取屏幕截图、基于坐标检查视图层级、执行点击/滑动/手势、输入文本和按下硬件按钮
  • SwiftPM:构建、运行、测试并管理 Swift Package Manager 项目
  • 项目脚手架:生成新的 iOS/macOS 项目模板
默认仅启用模拟器工作流工具。如果 device、macOS、debugging 或 UI automation 等能力不可用,用户必须配置 MobileBuildMCP 以启用这些能力。有关工作流配置,请参阅 https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/configuration.mdx。

Step 1: Establish Session Context

第 1 步:建立会话上下文

  • Call
    session_show_defaults
    before the first build/run/test action in a session.
  • Use
    discover_projs
    only when defaults show missing or incorrect project/workspace context.
  • Do not run discovery speculatively or in parallel with
    session_show_defaults
    .
  • For simulator run intent, prefer the combined build-and-run tool instead of separate build then run calls.
  • Do not chain build-only then build-and-run unless the user explicitly requests both.
  • 在会话中首次执行构建/运行/测试操作前,调用
    session_show_defaults
    。
  • 仅当默认值中缺少项目/工作区上下文或上下文不正确时,才使用
    discover_projs
    。
  • 不要推测性地执行发现操作,也不要将其与
    session_show_defaults
    并行运行。
  • 对于模拟器运行需求,优先使用组合式构建并运行工具,而不是分别调用构建和运行工具。
  • 除非用户明确要求同时执行两者,否则不要依次调用 build-only 和 build-and-run。

Step 2: Understand Workflow-Scoped Tool Availability

第 2 步:了解工作流范围内的工具可用性

  • Not all tools are enabled by default; tool availability depends on enabled workflows.
  • If a tool is expected but missing, check enabled workflows first.
  • Update enabled workflows in
    .mobilebuildmcp/config.yaml
    , then ask user to reload/restart the session to surface refreshes.
  • 并非所有工具都会默认启用;工具的可用性取决于已启用的工作流。
  • 如果某个预期工具缺失,请先检查已启用的工作流。
  • 在
    .mobilebuildmcp/config.yaml
    中更新已启用的工作流,然后请用户重新加载或重启会话,以刷新并显示工具。

Step 3: Report Context Clearly

第 3 步:清晰报告上下文

  • Return the active defaults context used for execution (project/workspace, scheme, simulator/device).
  • For failures, include the exact failing step and the next actionable command/tool call.
  • 返回用于执行操作的当前默认上下文,包括项目/工作区、scheme 和模拟器/设备。
  • 对于失败情况,请指出具体失败的步骤以及下一步可执行的命令或工具调用。