r/androiddev • • 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

11 comments sorted by

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/EstablishmentCute267 3h ago

thats slick solution! does it ever slow you down though? if one agents stuck on verifcation does it end up blocking the others?

1

u/tinmicto 2h ago

not really, at most i work on 2 apps, and the skill includes a device-checker subagent who always does the verification, so it never really holds up anything. + i do it in big chunks, so there would be many changes included in one pass while the main agent continues on working.

tbh, doing a code review before merging into your branch catches many of the slop before a device pass.

whichever route you go, ensure that that both are done by blind sub-agents (who does not know which code was changed exactly).

you can have your agent read about my setup here https://github.com/PickleHik3/claude-setup and see if there is anything you can adopt. but since its for claude primarily i would suggest to prompt it to check if it applies to codex.

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

1

u/EstablishmentCute267 3h ago

running the emulators is fine - but im trying to find the best way to pair it with an agent