ios-debugger-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseiOS Debugger Agent
iOS Debugger Agent
Overview
概述
Use XcodeBuildMCP to build and run the current project scheme on a booted iOS simulator, interact with the UI, and capture logs. Prefer the MCP tools for simulator control, logs, and view inspection.
使用XcodeBuildMCP在已启动的iOS模拟器上构建并运行当前项目scheme,与UI交互并捕获日志。优先使用MCP工具进行模拟器控制、日志查看和视图检查。
Core Workflow
核心工作流程
Follow this sequence unless the user asks for a narrower action.
除非用户要求更具体的操作,否则请遵循以下步骤。
1) Discover the booted simulator
1) 发现已启动的模拟器
- Call and select the simulator with state
mcp__XcodeBuildMCP__list_sims.Booted - If none are booted, ask the user to boot one (do not boot automatically unless asked).
- 调用并选择状态为
mcp__XcodeBuildMCP__list_sims的模拟器。Booted - 如果没有已启动的模拟器,请要求用户启动一个(除非用户要求,否则不要自动启动)。
2) Set session defaults
2) 设置会话默认值
- Call with:
mcp__XcodeBuildMCP__session-set-defaults- or
projectPath(whichever the repo uses)workspacePath - for the current app
scheme - from the booted device
simulatorId - Optional: ,
configuration: "Debug"useLatestOS: true
- 调用,参数包括:
mcp__XcodeBuildMCP__session-set-defaults- 或
projectPath(根据仓库使用的类型选择)workspacePath - 当前应用的
scheme - 已启动设备的
simulatorId - 可选参数:,
configuration: "Debug"useLatestOS: true
3) Build + run (when requested)
3) 构建 + 运行(当用户要求时)
- Call .
mcp__XcodeBuildMCP__build_run_sim - If the app is already built and only launch is requested, use .
mcp__XcodeBuildMCP__launch_app_sim - If bundle id is unknown:
mcp__XcodeBuildMCP__get_sim_app_pathmcp__XcodeBuildMCP__get_app_bundle_id
- 调用。
mcp__XcodeBuildMCP__build_run_sim - 如果应用已构建完成且仅需启动,请使用。
mcp__XcodeBuildMCP__launch_app_sim - 如果bundle id未知:
mcp__XcodeBuildMCP__get_sim_app_pathmcp__XcodeBuildMCP__get_app_bundle_id
UI Interaction & Debugging
UI交互与调试
Use these when asked to inspect or interact with the running app.
- Describe UI: before tapping or swiping.
mcp__XcodeBuildMCP__describe_ui - Tap: (prefer
mcp__XcodeBuildMCP__taporid; use coordinates only if needed).label - Type: after focusing a field.
mcp__XcodeBuildMCP__type_text - Gestures: for common scrolls and edge swipes.
mcp__XcodeBuildMCP__gesture - Screenshot: for visual confirmation.
mcp__XcodeBuildMCP__screenshot
当需要检查或与运行中的应用交互时使用以下工具。
- 描述UI:在点击或滑动前调用。
mcp__XcodeBuildMCP__describe_ui - 点击:调用(优先使用
mcp__XcodeBuildMCP__tap或id;仅在必要时使用坐标)。label - 输入文本:聚焦输入框后调用。
mcp__XcodeBuildMCP__type_text - 手势操作:调用执行常见的滚动和边缘滑动操作。
mcp__XcodeBuildMCP__gesture - 截图:调用进行视觉确认。
mcp__XcodeBuildMCP__screenshot
Logs & Console Output
日志与控制台输出
- Start logs: with the app bundle id.
mcp__XcodeBuildMCP__start_sim_log_cap - Stop logs: and summarize important lines.
mcp__XcodeBuildMCP__stop_sim_log_cap - For console output, set and relaunch if required.
captureConsole: true
- 启动日志捕获:使用应用的bundle id调用。
mcp__XcodeBuildMCP__start_sim_log_cap - 停止日志捕获:调用并总结重要日志行。
mcp__XcodeBuildMCP__stop_sim_log_cap - 如需捕获控制台输出,请设置,必要时重新启动应用。
captureConsole: true
Troubleshooting
故障排除
- If build fails, ask whether to retry with .
preferXcodebuild: true - If the wrong app launches, confirm the scheme and bundle id.
- If UI elements are not hittable, re-run after layout changes.
describe_ui
- 如果构建失败,询问用户是否要使用参数重试。
preferXcodebuild: true - 如果启动了错误的应用,请确认scheme和bundle id。
- 如果UI元素无法点击,请在布局变化后重新调用。
describe_ui