Codex can now stream iOS simulators right inside its browser
OpenAI Codex just added a Build iOS Apps plugin that mirrors an iOS Simulator directly into its in-app browser. It lets developers live-preview SwiftUI components outside Xcode Canvas and hot-reload Swift package edits on the fly, making iOS testing inside Codex seamless.
Anyone who has built apps for Apple's ecosystem knows the frustration: Xcode's native SwiftUI preview canvas often freezes, crashes, or takes forever to recompile. It is notoriously fragile, especially when an AI agent is trying to iterate on UI.
Codex is tackling this with a clever detour. A newly added Build iOS Apps plugin includes an iOS simulator browser skill that streams live simulator frames straight into Codex's in-app browser, ditching Xcode Canvas entirely for component previews.
Streaming the simulator to a local browser
Instead of trying to reinvent Apple's simulator stack, the plugin uses a clean piping mechanism.
When a user or the agent wants to inspect an app, the tool grabs an active simulator UDID using standard Apple command-line tools. It then fires up a background helper called serve-sim via npx.
This helper turns the local iOS simulator screen into a web stream and generates a local preview URL. Once loaded inside Codex's built-in browser, developers can watch and interact with the running iOS environment without leaving the workspace.
The process also enforces strict cleanup routines. Process traps ensure the helper service is killed immediately when the terminal closes, and the workflow requires verifying that real video frames are rendering rather than simply checking if a web page loaded.
Hot reloading outside your source tree
Streaming pixels is one thing, but iterating on SwiftUI components in real time is where things get interesting.
For Swift packages, the plugin bundles a specialized launcher script. You point it at a Package.swift manifest and select a target. Instead of touching your existing setup, it creates a disposable host application outside your project repository, builds it, and boots it inside the simulator.
A watch mode is active by default. Whenever a Swift source file is edited, the launcher compiles a fresh dynamic library and hot-swaps it into the running host process without relaunching the app. You get instant updates on screen.
The tool supports both traditional PreviewProvider declarations and the newer #Preview macros, allowing filtering via regular expressions to focus on specific UI variants. Crucially, its design boundary forbids touching existing Xcode project files, workspaces, schemes, or build settings, preventing repository pollution.
Why it matters
We think this is a massive leap forward for AI-assisted mobile engineering. While web developers have enjoyed lightning-fast feedback loops with tools like Vite, native mobile development has always been a walled garden that resists automated tooling.
By streaming the simulator directly into Codex's browser, AI agents can finally close the visual QA loop. An agent can edit a view, wait for the hot reload to swap the binary, capture a screenshot from the in-app browser, and verify layout geometry all on its own.
The architecture is remarkably sensible. Rather than fighting fragile project files, isolating views inside modular Swift Packages and using disposable host apps keeps the user's workspace completely untouched.
The catch is that this setup still demands a fully configured local Mac with Xcode and running simulators. It is also tailored primarily for modular Swift Packages rather than sprawling, monolithic legacy targets.
Even so, this points toward a much friendlier future for native app development with AI. Bringing live visual feedback and hot reload into an agent workspace removes one of the biggest friction points in iOS development.
Sources (1)
- github.com(opens in a new tab)Originalgithub.com