r/androiddev • u/EstablishmentCute267 • 6h ago
Question How are you running multiple coding agents in parallel with devices?
I've been using Codex for Android development and am starting to experiment with running multiple agents on separate worktrees.
What's your current setup for this? Especially when agents need to build and actually run the app.
2
Upvotes
1
u/tinmicto 5h ago
i use 2 emulators and 1 phone, have a skill which i created with Claude itself, which has a lease file, so agents know if the device is free or not.
i font know if codex's agents can talk to each other, but in claude code, agents can communicate with each other across sessions, so they often announce themselves that they're taking the lease for a device for x amount of time, and during the lease if another commit had landed to a branch, they let each other know and covers the change in one device verification pass. Its pretty cool imo.
1
u/AutoModerator 6h ago
Please note that we also have a very active Discord server where you can interact directly with other community members!
Join us on Discord
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/jeefo12 6h ago
sesori.com allows you to easily start a new work tree for each session and works with codex.
Aside from this, Claude code also creates worktrees itsfelf as needed without any additional setup. Not sure if codex does this on its own today.
1
u/Opulence_Deficit 5h ago
I'm using just one, but it shows affinity to one device and doesn't try to use others unless explicitly told to. So I guess, each agent can be told to stick to its device.
1
u/CandidSystem6155 3h ago
Worktree per agent works, two things made it hold up for us. Git refuses to check out the same branch in two worktrees, so each agent gets its own branch and commits after every logical step. If two tasks touch the same files, we run them one after the other instead of in parallel, merging later costs more than the wait.
For devices, pin each agent to one serial. adb and the Gradle install tasks respect ANDROID_SERIAL, so setting it per agent shell (emulator-5554, emulator-5556, the phone's serial) keeps installDebug from landing on every connected device and the agents stop stepping on each other's app state.
1
u/Andriyo 2h ago
Olef CLI for Android has a concept of sessions. Basically to allow agents to play nice together when multiple agents are running debug/development runs on multiple emulators. Added benefit is that it allows to rollback any configuration settings so an emulator is returned in precine condition.
0
u/bleeding182 5h ago
Assuming that you're not working on a potato you can easily run 3-4 emulators