Build for iOS | Codex use cases
Need
Project automation
Default options
Why it's needed
A strong option once you need Codex to inspect schemes and targets, launch the app, capture screenshots, and keep iterating without leaving the agentic loop.
7 added, 127 removed.
Need
Project automation
Default options
Why it's needed
A strong option once you need Codex to inspect schemes and targets, launch the app, capture screenshots, and keep iterating without leaving the agentic loop.
11name: Build for iOS# Build for iOS | Codex use cases
2tagline: Use Codex to scaffold, build, and debug SwiftUI apps for iPhone and iPad.
3summary: Use Codex to scaffold iOS SwiftUI projects, keep the build loop
4 CLI-first with `xcodebuild` or Tuist, and add XcodeBuildMCP or focused SwiftUI
5 skills when the work gets deeper.
6skills:
7 - token: build-ios-apps
8 url: https://github.com/openai/plugins/tree/main/plugins/build-ios-apps
9 description: Build or refactor SwiftUI UI, adopt modern iOS patterns such as
10 Liquid Glass, audit runtime performance, and debug apps on simulators with
11 XcodeBuildMCP-backed workflows.
12bestFor:
13 - Greenfield iOS SwiftUI apps where you want Codex to scaffold the app and
14 build loop from scratch
15 - Existing iPhone and iPad projects where Codex needs schemes, simulator
16 output, screenshots, or UI automation before the work is done
17 - Teams that want long-running iOS UI tasks to stay agentic and CLI-first
18 instead of depending on the Xcode GUI
19starterPrompt:
20 title: Scaffold the App and Build Loop
21 body: >-
22 Scaffold a starter SwiftUI app and add a build-and-launch script I can wire
23 to a `Build` action in my local environment.
24 2
3Need
25 4
265 Constraints:Project automation
27 6
287 - Stay CLI-first. Prefer Apple's `xcodebuild`; if a cleaner setup helps,Default options
29 it's okay to use Tuist.
30 8
319 - If this repo already contains a full Xcode project, use XcodeBuildMCP to[XcodeBuildMCP](https://www.xcodebuildmcp.com/)
32 list targets, pick the right scheme, build, launch, and capture screenshots
33 while you iterate.
34 10
3511 - Reuse existing models, navigation patterns, and shared utilities when theyWhy it's needed
36 already exist.
37 12
3813 - Keep the app focused on iPhone and iPad unless I explicitly ask for aA strong option once you need Codex to inspect schemes and targets, launch the app, capture screenshots, and keep iterating without leaving the agentic loop.
39 shared Apple-platform implementation.
40 14
41 - Use a small trustworthy validation loop after each change, then expand to
42 broader builds only when the narrower check passes.
43
44 - Tell me whether you treated this as a greenfield scaffold or an
45 existing-project change.
46
47
48 Deliver:
49
50 - the app scaffold or requested feature slice
51
52 - a small build-and-launch script with the exact commands
53
54 - the smallest relevant validation steps you ran
55
56 - the exact scheme, simulator, and checks you used
57relatedLinks:
58 - label: Model Context Protocol
59 url: /codex/mcp
60 - label: Agent skills
61 url: /codex/skills
62techStack:
63 - need: UI framework
64 goodDefault: "[SwiftUI](https://developer.apple.com/documentation/swiftui/)"
65 why: The fastest way to prototype views, navigation, and shared state for iPhone
66 and iPad while keeping the UI code readable.
67 - need: Build tooling
68 goodDefault: xcodebuild or [Tuist](https://docs.tuist.dev/)
69 why: Both keep the native build loop in the terminal instead of depending on the
70 Xcode GUI.
71 - need: Project automation
72 goodDefault: "[XcodeBuildMCP](https://www.xcodebuildmcp.com/)"
73 why: A strong option once you need Codex to inspect schemes and targets, launch
74 the app, capture screenshots, and keep iterating without leaving the
75 agentic loop.
76 - need: Distribution tooling
77 goodDefault: "[App Store Connect CLI](https://asccli.sh/)"
78 why: Keep your agent fully in the loop and send your app build directly to the
79 App Store.
80
81## Scaffold the app and build loop
82
83For greenfield work, start with plain prompting. Ask Codex to scaffold a starter iOS SwiftUI app and write a small build-and-launch script you can wire to a `Build` action in a [local environment](https://developers.openai.com/codex/app/local-environments).
84
85Keep the loop CLI-first. Apple's `xcodebuild` can list schemes and handle build, test, archive, `build-for-testing`, and `test-without-building` actions from the terminal, which lets Codex stay in an agentic loop instead of bouncing into the Xcode GUI.
86
87If you want a cleaner project generator and you're comfortable with third-party tooling, [Tuist](https://tuist.dev/) is a good next step. It can generate and build Xcode projects without needing the GUI, while still letting Codex build and launch the app from the terminal.
88
89Use [XcodeBuildMCP](https://www.xcodebuildmcp.com/) once you're inside a full Xcode project and need deeper automation. That's when schemes, targets, simulator control, screenshots, logs, and UI interaction matter enough that plain shell commands stop being the whole story.
90
91## Leverage skills
92
93For the first pass, you often don't need a skill or MCP server. Add skills once the work gets specialized or you want stronger SwiftUI conventions baked into the run.
94
95- [SwiftUI expert](https://github.com/AvdLee/SwiftUI-Agent-Skill) is a strong general-purpose SwiftUI skill with a lot of best practices already baked in.
96- [SwiftUI Pro](https://github.com/twostraws/SwiftUI-Agent-Skill/blob/main/swiftui-pro/SKILL.md) is a broad SwiftUI review skill for modern APIs, maintainability, accessibility, and performance.
97
98- [Liquid Glass expert](https://github.com/Dimillian/Skills/blob/main/swiftui-liquid-glass/SKILL.md) helps Codex adopt the new iOS 26 Liquid Glass APIs and tune custom components so they fit the latest system design.
99- [SwiftUI performance](https://github.com/Dimillian/Skills/blob/main/swiftui-performance-audit/SKILL.md) helps when a feature feels slow or a SwiftUI view update path looks suspicious. It scans for common SwiftUI mistakes and produces a prioritized report of what to fix and where the biggest gains are.
100- [Swift concurrency expert](https://github.com/Dimillian/Skills/blob/main/swift-concurrency-expert/SKILL.md) helps when cryptic errors and compiler warnings start fighting the change you want to make. On GPT-5.4, you may need it less often, but it's still useful when Swift concurrency diagnostics get noisy.
101- [SwiftUI view refactor](https://github.com/Dimillian/Skills/blob/main/swiftui-view-refactor/SKILL.md) helps keep files smaller and make SwiftUI code more consistent across the repo.
102- [SwiftUI patterns](https://github.com/Dimillian/Skills/blob/main/swiftui-ui-patterns/SKILL.md) helps reach for predictable `@Observable` and `@Environment` architecture patterns as the app grows.
103
104To learn more about how to install and use skills, see our [skills documentation](https://developers.openai.com/codex/skills).
105
106## Iterate
107
108Once you have a first pass working, or if you're starting from an existing project, you can start iterating on the UI or behavior.
109
110For this part, be specific about what you want to change and how you want to change it.
111
112Make that prompting layer explicit: tell Codex whether it's working in a greenfield repo or an existing Xcode project, which iOS devices or deployment targets must keep working, and what validation loop you expect.
113
114### Example prompt
115
116For example, if you want to add a feature to an existing app, you can ask Codex for a change like this:
117
118## Practical tips
119
120### Start with basics
121
122Start with plain prompting for greenfield work. Ask Codex to scaffold a starter SwiftUI app and write a small build-and-launch script you can wire to a `Build` action in a [local environment](https://developers.openai.com/codex/app/local-environments). For that first pass, you often don't need any skill or MCP server.
123
124### Use a small trustworthy validation loop
125
126After each change, tell Codex to run the narrowest command that actually proves the contract you touched. Expand to broader builds later. This keeps Codex fast without pretending a full app build is required for every edit.
127
128### Keep the loop CLI-first
129
130Keep the loop CLI-first. Apple's `xcodebuild` tool can list schemes and run build, test, archive, `build-for-testing`, and `test-without-building` actions from the terminal, which lets Codex stay in an agentic loop instead of bouncing into the Xcode GUI.
131
132### Leverage XcodeBuildMCP
133
134Use XcodeBuildMCP as soon as you are inside a full Xcode project and need deeper automation. That's the point where schemes, targets, simulator control, screenshots, logs, and UI interaction matter enough that plain shell commands stop being the whole story.