Codex on a macOS environment with Xcode and Simulators
Codex can build and test iOS apps when its environment has macOS, Xcode and an iOS Simulator. Macswarm supplies that environment as a Pod requested through the OpenAI Agents API webhook. This is an agent execution environment; Apple's Xcode Cloud is a separate service for CI builds and tests.
Is a Codex macOS environment the same as Xcode Cloud?
No. A Codex macOS environment is a Mac where Codex runs commands, builds and drives an app; Xcode Cloud is Apple’s CI service, which runs workflows you define and hosts no agent. On Macswarm the environment is a Pod: a hosted Mac with the Latest Xcode and three to four pre-booted Simulators, requested through the OpenAI Agents API webhook you register as the sandbox webhook. Codex builds with xcodebuild, leases a Simulator, taps through the app with XcodeBuildMCP and attaches logs and screenshots to the pull request. OpenAI bills the model usage; Macswarm bills Pod-hours, metered per second until ten minutes after the last session ends, with 3 Pod-hours free once. Xcode Cloud bills compute hours for workflow builds and tests, and includes 25 of them a month with Apple Developer Program membership (Apple, checked 25 Oct 2026). With no agent in the loop, Xcode Cloud is the better choice; the two combine when Codex pushes a branch that Xcode Cloud builds.
Macswarm vs Xcode Cloud has the side-by-side table and the full Xcode Cloud tier list.
How do I connect Codex to a Macswarm Pod?
In the Agents API’s terms, the Pod is the self-hosted sandbox and Macswarm answers the webhook. Macswarm is in early access: steps that mention the dashboard describe the current build, and exact labels may change before general availability. If a control does not match what you see, write to info@macswarm.com.
- Sign up or sign in. Open Environments, choose Connect Codex and pick a region, EU or US.
- Copy the webhook URL. It is unique to your account and can be rotated at any time.
- Paste the URL into your Agents API environment settings as the sandbox webhook. Add the deploy key or GitHub App that lets Pods clone your repositories, and the secrets your builds need.
- Start a Codex session from the Codex app or your workflow, pick the Macswarm environment and give it a task that needs a Mac. Codex requests a Pod when a task needs Xcode or a Simulator; Linux tasks keep using your other sandboxes.
- Follow the run through the logs and screenshots in the Macswarm dashboard and in the pull request.
Build Tidewater for an iPhone Simulator, tap through onboarding and attach a screenshot of every screen.
Start free with 3 Pod-hours, once, with no card; the pricing page has the four plans. The Codex quickstart repeats these steps with a troubleshooting section for a webhook Codex never calls, a failed clone and a full build queue.
What does a Macswarm Pod add?
What arrives when the webhook fires:
- A macOS VM on a dedicated Apple silicon Mac mini, in the Netherlands (EU) or the US, booted from a warm pool in a few seconds.
- The Latest Xcode and the previous major version, with command line tools; current and previous iOS runtimes.
- Three to four Simulators booted before the session starts, leased to an agent for a launch or a test run and returned to the pool.
- XcodeBuildMCP, git, Homebrew packages, and Node, Python and Ruby for fastlane and CocoaPods.
- A build queue with two concurrent
xcodebuildslots, shared fairly between agents. - Outbound connections only:
api.openai.com, your git host and the package registries a build needs. - Destruction ten minutes after the last session. Macswarm pushes a rescue branch with leftover changes before destroying the Pod; Pod-local caches, credentials and build products do not persist.
Claude Code sessions from the same developer can share the Pod; the Claude Code quickstart covers that connection. Inside a Pod has the full inventory and Limits and queues the sharing numbers. OpenAI bills the model usage; Macswarm bills the Pod-hours: Free includes 3 Pod-hours once; Pro costs $99 a month for 300 Pod-hours.
Can Codex use the iOS Simulator in a cloud session?
On a Pod, yes. OpenAI’s Debug in iOS simulator use case describes the loop it expects Codex to run: “choose the right app target, launch the app in Simulator, inspect the current screen, perform the reproduction steps”, then “gather logs and screenshots, inspect a stack trace if needed, patch the code”, and “rerun the same path to prove the bug is gone.” That loop runs on a Pod through the same XcodeBuildMCP, with the Simulators already booted when the session starts. Codex leases one for the launch or the test run; a lease idle for five minutes is released. Screenshots and logs show up in the Macswarm dashboard and the pull request. iOS Simulator for coding agents walks through the loop step by step.
In OpenAI’s own hosted environments, the current page cited below does not specify an operating system or establish Xcode availability, and xcodebuild and Apple’s iOS Simulator run only on macOS.
What does OpenAI document about environments?
The following describes the provider interface. For Macswarm, follow the webhook setup above; nothing here is extra customer setup.
Codex Cloud environments. OpenAI’s current page defines one as “the reusable setup that tasks use: repositories, dependencies, tools, and access settings”, and says “Each cloud task runs in a VM” (Cloud environments). The current page cited here does not specify an operating system or establish Xcode availability, and lists “Computer and browser use” as unsupported. The older page, now labelled Codex Cloud (Legacy), says “The Codex agent runs in a default container image called universal” (Codex Cloud (Legacy) environments). The codex-universal repository that builds that image “builds the image for both linux/amd64 and linux/arm64. However we only run the linux/amd64 version.” The legacy image describes a Linux environment.
Agents API environments. The environment is “Where the agent runs commands, executes code, and works with files”, and it “can be a remote sandbox, your laptop, a Docker container, or an AWS Lambda function” (Architecture). With environment.type set to openai_hosted, “OpenAI creates and manages a sandbox for the session.” With self_hosted, for when the agent needs “your infrastructure, private network, or custom software”, the provider’s code starts the environment and connects the executor: “You run codex exec-server, the executor, inside your environment.” “All connections are outbound.” “The executor registers with the API using an environment ID and a restricted API key” (Self-hosted sandboxes). In webhook-managed provisioning, the API emits agent.session.action_required with required_action.type: "environment_connection" and the handler starts the environment (Sandbox lifecycle). On Macswarm, that handler and executor are Macswarm’s; you register the webhook and start sessions.
XcodeBuildMCP. OpenAI’s iOS use case goes through XcodeBuildMCP, which requires a Mac with a supported Xcode installation; Pods include the Latest Xcode.
Neither set of OpenAI pages mentions macOS, Xcode or the Simulator.
What are the alternatives?
| Option | Workflow | Cost | Persistence | Better fit |
|---|---|---|---|---|
| Your own Mac with the Codex app or CLI | OpenAI’s iOS use case is written for this: Codex drives Xcode and the Simulator on your desk | No additional Mac hosting charge if you already own the hardware; OpenAI model usage is billed separately | Your own disk | One developer with one Mac who runs one agent at a time |
| NoMac per-minute Mac | A disposable Mac with Xcode and root access, reached “over MCP, the CLI, the API or SSH” | $0.80 an hour, billed by the minute, from $10 of prepaid credit (checked 25 Oct 2026) | An encrypted drive that follows you between Macs | Short bursts of Mac time, or SSH and a persistent drive; see Macswarm vs NoMac |
| MacRun rented Mac mini | A dedicated machine with “Claude Code and Codex installed, waiting for your sign-in” | $169 a month (checked 25 Oct 2026) | The machine is yours all month | An agent that works around the clock on one machine you administer; see Macswarm vs MacRun |
| Xcode Cloud | Apple’s CI runs builds, tests and TestFlight uploads from a workflow, not an agent session | 25 compute hours a month with Apple Developer Program membership; 100 hours cost $49.99 (checked 25 Oct 2026) | Ephemeral build environments | CI with no agent in the loop; see Macswarm vs Xcode Cloud |
| An OpenAI-hosted environment | “OpenAI creates and manages a sandbox for the session” | Billed by OpenAI | Managed by OpenAI | Everything that is not iOS; route only Mac work to a Pod |
| Macswarm Pod | Codex requests a Pod through the Agents API webhook; the Latest Xcode and pre-booted Simulators are ready | Free 3 Pod-hours once; Pro $99 a month for 300 Pod-hours (pricing) | Nothing between sessions; a rescue branch carries leftover changes | iOS tasks from Codex sessions, two to three agents per Pod for one developer, EU or US |
What else do people ask?
Does Codex need anything special to use a Pod?
An OpenAI account with API access and a Macswarm account. Codex requests the Pod through the Agents API webhook you register; no Claude plan is involved. OpenAI bills the model usage and Macswarm bills the Pod-hours. Free includes 3 Pod-hours once, with one Pod at a time; Pro costs $99 a month for 300 Pod-hours, with four Pods at a time.
Which Xcode is on the Pod?
The Latest Xcode and the previous major version, with command line tools, plus the current and previous iOS runtimes so an app can be checked on both. Three to four Simulators are booted before the session starts and leased to agents per launch or test run. Node, Python and Ruby for fastlane and CocoaPods are in the image. If your project needs something else, write to info@macswarm.com.
Can Claude Code share the Pod with Codex?
Yes, for the same developer. One Pod belongs to one developer, and that developer’s Claude Code and Codex sessions share it in separate git worktrees. The build queue has two slots and the Simulator pool three to four devices; neither cares which agent is asking. Two to three active agents per standard Pod are guaranteed; more are allowed and queue for builds and Simulators. Limits and queues has the numbers, and the Claude Code quickstart covers the other agent’s setup.
What happens when the session ends?
Codex commits and pushes before the session ends. Macswarm pushes a rescue branch with leftover changes before destroying the Pod. Ten minutes after the last session the Pod is destroyed and the meter stops. Pod-local caches, credentials and build products do not persist; derived data that matters belongs in your repository or your CI cache.
Where are the Macs and who can reach them?
Dedicated Apple silicon Mac minis that Macswarm operates in a data center in the Netherlands (EU) or in the US; you choose the region per environment. Each Mac mini runs two Pods as separate virtual machines. Pods make outbound connections only, to api.openai.com, your git host and package registries. There is no SSH or screen sharing, for customers or for Macswarm staff. Security has the isolation model.