Codex Use Case

在 iOS 模拟器中调试

结合 Codex 和 XcodeBuildMCP 驱动 iOS Simulator,捕获证据并调试问题。 本页把官方 use case 的章节、工具、起步提示词和检查点整理成中文执行流程,便于直接对照落地。

iOS Code
Debug in iOS simulator iOSCode

场景定位

结合 Codex 和 XcodeBuildMCP 驱动 iOS Simulator,捕获证据并调试问题。 本页把官方 use case 的章节、工具、起步提示词和检查点整理成中文执行流程,便于直接对照落地。

难度
高级
时间跨度
约 30-60 分钟

适合用于

  • 需要把「结合 Codex 和 XcodeBuildMCP 驱动 iOS Simulator,捕获证据并调试问题。」做成可复用流程的团队,且来源分散在 Build iOS Apps 等工具中
  • 希望 ChatGPT 或 Codex 保留来源、检查点和可审阅输出的使用者
  • 需要把「在 iOS 模拟器中调试」从一次性对话变成可复查工作流的场景

Skills & Plugins

相关工具

Starter Prompt

起步提示词

Use the Build iOS Apps plugin and XcodeBuildMCP to reproduce this bug directly in Simulator, diagnose the root cause, and implement a small fix.

Bug report:
[Describe the expected behavior, the actual bug, and any known screen or account setup.]

Constraints:
- First check whether a project, scheme, and simulator are already selected. If not, discover the right Xcode project or workspace, pick the app scheme, choose a simulator, and reuse that setup for the rest of the session.
- Build and launch the app in Simulator, then confirm the right screen is visible with a UI snapshot or screenshot before you start interacting with it.
- Drive the exact reproduction path yourself by tapping, typing, scrolling, and swiping in the simulator. Prefer accessibility labels or IDs over raw coordinates, and re-read the UI hierarchy before the next action when the layout changes.
- Capture evidence while you debug: screenshots for visual state, simulator logs around the failure, and LLDB stack frames or variables if the bug looks like a crash or hang.
- If the simulator is not already booted, boot one and tell me which device and OS you chose. If credentials or a special fixture are required, pause and ask only for that missing input.
- Make the smallest code change that addresses the bug, then rerun the simulator flow and tell me exactly how you verified the fix.

Deliver:
- the reproduction steps Codex executed
- the key screenshots, logs, or stack details that explained the bug
- the code fix and why it works
- the simulator and scheme used for final verification
在 ChatGPT 中尝试

提供 Codex the whole simulator loop

这一节对应官方流程中的「Give Codex the whole simulator loop」。落地时围绕「在 iOS 模拟器中调试」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

操作要点:运行最小可信验证并保存证据,并关注 Codex 等相关来源或工具,让后续审查能看到命令、结果和失败处理方式。

操作要点:把已确认的上下文转成「在 iOS 模拟器中调试」所需的可审阅草稿或交付物,并关注 Codex、iOS、XcodeBuildMCP 等相关来源或工具,并保留后续修改入口。

操作要点:把已确认的上下文转成「在 iOS 模拟器中调试」所需的可审阅草稿或交付物,并关注 Codex、XcodeBuildMCP 等相关来源或工具,并保留后续修改入口。

利用 what XcodeBuildMCP can do

产出阶段应把「结合 Codex 和 XcodeBuildMCP 驱动 iOS Simulator,捕获证据并调试问题。」转成可编辑、可审阅的交付物,并保留结构、来源和后续修改入口。

操作要点:围绕「Leverage what XcodeBuildMCP can do」推进「在 iOS 模拟器中调试」时,保持目标、输入、执行步骤和验证结果一致,并关注 Codex 等相关来源或工具。

操作要点:把已确认的上下文转成「在 iOS 模拟器中调试」所需的可审阅草稿或交付物,并关注 Codex、XcodeBuildMCP 等相关来源或工具,并保留后续修改入口。

  • 把已确认的上下文转成「在 iOS 模拟器中调试」所需的可审阅草稿或交付物,并关注 Codex 等相关来源或工具,并保留后续修改入口。
  • 把已确认的上下文转成「在 iOS 模拟器中调试」所需的可审阅草稿或交付物,并关注 Codex 等相关来源或工具,并保留后续修改入口。
  • 围绕「Leverage what XcodeBuildMCP can do」推进「在 iOS 模拟器中调试」时,保持目标、输入、执行步骤和验证结果一致。
  • 运行最小可信验证并保存证据,让后续审查能看到命令、结果和失败处理方式。

转换 a vague bug into a reproducible script

这一节对应官方流程中的「Turn a vague bug into a reproducible script」。落地时围绕「在 iOS 模拟器中调试」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

操作要点:运行最小可信验证并保存证据,并关注 Codex、iOS 等相关来源或工具,让后续审查能看到命令、结果和失败处理方式。

实用提示

这一节对应官方流程中的「Practical tips」。落地时围绕「在 iOS 模拟器中调试」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

小节:Ask for evidence, not just a fix。

操作要点:在继续执行前检查来源、假设、受众、权限和输出质量,并关注 Codex 等相关来源或工具;不确定内容应进入待确认列表。

小节:Prefer accessibility labels over coordinates。

操作要点:运行最小可信验证并保存证据,并关注 Codex 等相关来源或工具,让后续审查能看到命令、结果和失败处理方式。

小节:Keep one bug per 运行。

操作要点:在继续执行前检查来源、假设、受众、权限和输出质量,并关注 Codex 等相关来源或工具;不确定内容应进入待确认列表。

Prompt Library

建议提示词

先界定范围

For Debug in iOS simulator, first inspect the available sources and propose the smallest useful scope. Name the inputs, outputs, validation steps, permissions, and anything that needs approval before action.

交付前复核

Review the result for Debug in iOS simulator. Check source coverage, assumptions, unresolved questions, and the evidence that proves the output is ready to use.

技术栈

需要 Simulator automation
默认选项 XcodeBuildMCP
为什么需要

The current tool surface covers simulator setup, 构建 and launch, UI snapshots, taps, typing, gestures, screenshots, log capture, and debugger attachment.

需要 Agent 工作流
默认选项 构建 iOS Apps plugin
为什么需要

The plugin's iOS debugger agent gives Codex a clear simulator-first loop for reproducing a bug, gathering evidence, and validating the fix after each 变更.

需要 App observability
默认选项 Logger , OSLog , LLDB, and Simulator screenshots
为什么需要

Codex 可以 使用 logs and debugger state to explain what broke, then save screenshots to prove the exact UI state before and after the fix.