You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: emulators start without gRPC, so tools that need the emulator gRPC endpoint (Argent) cannot drive leased devices #639
writes no discovery file (~/Library/Caches/TemporaryItems/avd/running/pid_<pid>.ini on macOS).
Without -port, the emulator turns on gRPC by default (console port + 3000, with a token) and writes the file.
Tools that drive the emulator over gRPC read that file. Argent is one. On a leased emulator its screenshot and gesture-tap fail with:
emulator "emulator-5558" not found among running emulators (a token-less `-grpc` launch omits grpc.token; check avd/running/*.ini)
adb-only tools still work, so the device looks healthy. Argent documents the same failure for any emulator launched without -grpc: software-mansion/argent#1192.
Repro (macOS, emulator 36.6.11, simlock 0.2.0)
simlock lease --platform android --device "Pixel 9" --agent-id test --detach
ls ~/Library/Caches/TemporaryItems/avd/running/ → no pid_*.ini for the leased emulator.
lsof -nP -iTCP -sTCP:LISTEN -p <emulator pid> → console and adb ports only, no gRPC port.
Matrix (throwaway AVD, launched by hand)
Flags
gRPC endpoint + .ini
-port 5570 -no-snapshot-save
no
no -port
yes, grpc.port=8556
-port 5570 -grpc 8570 -grpc-use-token
yes, and Argent works
Proposed fix
Add -grpc <port + 3000> -grpc-use-token to the emulator launch args.
Base the gRPC port on the console port, like the emulator's own default, so parallel leases never collide. With console ports above 5585 on main, it may be worth checking that port + 3000 stays clear of other simlock-managed ports.
The token keeps the endpoint authenticated. Argent also requires grpc.token in the .ini.
Users cannot work around this: config cannot add raw emulator flags (by design, per the comment near emulatorLaunchFlags).
Optional: expose the gRPC port in the grant, so tools do not have to find it through the discovery file.
Confirmed. This is a gap: no ADR or doc promises a gRPC endpoint, so the test's expectation (-grpc <console port + 3000> -grpc-use-token on every launch) is a proposal.
src/drivers/android/index.test.ts on bug/639-repro, "boots every launch of an emulator on %s with a token gRPC endpoint at the console port plus 3000". Two cases: the first console port, and one after a taken port.
src/drivers/android/index.ts:2071-2081: #startEmulator passes -port <n> but never -grpc. The reporter's matrix shows that the emulator then starts no gRPC server and writes no avd/running/pid_*.ini. Argent reads that file, so it cannot find the device, while adb-only tools still work. Config cannot add the flag, because emulatorLaunchFlags (index.ts:2635) maps only four fixed settings. Local emulator -help (36.5.11) lists both -grpc <port> and -grpc-use-token.
Simplest fix
Add "-grpc", String(data.port + 3000), "-grpc-use-token" after -no-snapshot-save in #startEmulator. With that change the repro passes. The 32 existing tests that assert the exact emulator argv need the three new args. Update the Boot section of the Android driver manual.
Alternatives rejected
A config switch for gRPC: it turns a default every tool expects into an opt-in.
Exposing the gRPC port in the grant: it is new surface (protocol bump). Tools already find the port through the .ini. A separate change if wanted.
A gRPC port from its own range: needs a new allocator. +3000 matches the emulator's own default.
Risk
consolePortsInUse (index.ts:2349) probes only port and port+1. A busy 8586–8682 port is not checked; confirm the emulator still boots when it is.
On hardware, check that the endpoint binds to loopback only.
On hardware, check that a baseline captured without -grpc still loads with it, so the upgrade does not wipe devices.
Maintainer: deliver the proposed fix. Start emulators with -grpc <console port + 3000> -grpc-use-token, and make the free-port check (consolePortsInUse) cover the +3000 port. The slow lane must confirm two things on a real emulator: gRPC listens on localhost only, and an existing snapshot still loads with -grpc.
Activity
robrechtme commentedon Oct 20, 2026
@V3RON tagging you to make sure you see this 😄
V3RON commentedon Oct 24, 2026
Reproduction
Confirmed. This is a gap: no ADR or doc promises a gRPC endpoint, so the test's expectation (
-grpc <console port + 3000> -grpc-use-tokenon every launch) is a proposal.src/drivers/android/index.test.tsonbug/639-repro, "boots every launch of an emulator on %s with a token gRPC endpoint at the console port plus 3000". Two cases: the first console port, and one after a taken port.Root cause
src/drivers/android/index.ts:2071-2081:#startEmulatorpasses-port <n>but never-grpc. The reporter's matrix shows that the emulator then starts no gRPC server and writes noavd/running/pid_*.ini. Argent reads that file, so it cannot find the device, while adb-only tools still work. Config cannot add the flag, becauseemulatorLaunchFlags(index.ts:2635) maps only four fixed settings. Localemulator -help(36.5.11) lists both-grpc <port>and-grpc-use-token.Simplest fix
Add
"-grpc", String(data.port + 3000), "-grpc-use-token"after-no-snapshot-savein#startEmulator. With that change the repro passes. The 32 existing tests that assert the exact emulator argv need the three new args. Update the Boot section of the Android driver manual.Alternatives rejected
.ini. A separate change if wanted.+3000matches the emulator's own default.Risk
consolePortsInUse(index.ts:2349) probes only port and port+1. A busy 8586–8682 port is not checked; confirm the emulator still boots when it is.-grpcstill loads with it, so the upgrade does not wipe devices.Written by an agent.
V3RON commentedon Oct 25, 2026
Decision
Maintainer: deliver the proposed fix. Start emulators with
-grpc <console port + 3000> -grpc-use-token, and make the free-port check (consolePortsInUse) cover the +3000 port. The slow lane must confirm two things on a real emulator: gRPC listens on localhost only, and an existing snapshot still loads with-grpc.Written by an agent.
github-actions commentedon Oct 28, 2026
Claim released: no activity for 3 days. The label is unchanged; the next agent starts from the branch and the last handoff.
test: reproduce callstackincubator#639 — emulators boot without a tok…
fix(android): start every emulator with a token gRPC endpoint at the …
test(android): the slow lane confirms gRPC listens on loopback only a…
chore(android): gRPC launch test expectations pass the format check (c…
test: the gRPC endpoint follows the reserved console port (callstacki…
fix(android): a busy gRPC port skips its console port (callstackincub…
fix(android): start emulators with an authenticated gRPC endpoint (ca…