返回资讯中心
外部精选
软件工程
#开发者实时流

How to Run Multiple Claude Code Agents on the Same Xcode Project

Learn how to run multiple Claude Code agents on the same Xcode project without simulator conflicts.

Hacker News 最新afterxleep2026/10/29 · 今天6 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Learn how to run multiple Claude Code agents on the same Xcode project without simulator conflicts.

Running two or more Claude Code agents on one Xcode project is the natural next step once a single agent works well. The expectation is two tasks in roughly the time of one.

Where it goes wrong is not in the code. An iOS project shares more than files: the simulator, the installed app, and the data the app saved. I wanted to see what happens when two agents reach that shared part.

I gave two Claude Code agents separate tasks on a small SwiftUI weather app, each in its own Git worktree. One added a feature. The other added a test. Neither prompt named a simulator.

Both agents picked the iPhone 18 Pro that was already booted. Both builds succeeded, and both reported success.

Then I checked what was installed. The simulator was running the second agent's build, and the first agent's build had been replaced. Neither agent's output mentioned the other, or that its build was gone.

Worktrees keep files apart. They don't keep simulators apart.

If two sessions install the same app on one simulator, they share the same build, app data, and screen. To see it, I built the app from two worktrees with different build numbers (111 and 222) and the same bundle ID. The first worktree branch (let's call it Agent A) installed and launched its build, then the second (Agent B) installed its own, both on one simulator. The commands and results are specific to this example app, and the full run is in this gist:

https://gist.github.com/amarildolucas/257229e7f3eeff3de073614a934e4b6a

Four things happened, and none of them raised an error:

The simulator held build 222. Agent A’s build 111 was gone.

The app that A had launched was no longer running. The log shows the install sending a terminate request to the running app.

The cities that build 111 saved in UserDefaults were still there for build 222. The log shows No saved cities found; seeding defaults (2) on first launch and loadCities loaded 2 cities from UserDefaults afterward. Installing over an existing app keeps its data; only uninstalling removes it.

When both agents launched their app afterward, simctlreturned the same process ID. Agent Awas now running B’s build, and reading the installed build number gave 222, not the 111 it had built.

The manual test forces the collision. Real agents don't need forcing. I started one session per worktree with claude --worktree and gave each agent an ordinary task, the way you would without thinking about simulators.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →