Skip to content

feat(panel): connect to the device's discovered gRPC port (not hardcoded 8554) - #51

Merged
dev-josias merged 1 commit into
mainfrom
feat/panel-grpc-port
Jul 1, 2026
Merged

feat(panel): connect to the device's discovered gRPC port (not hardcoded 8554)#51
dev-josias merged 1 commit into
mainfrom
feat/panel-grpc-port

Conversation

@dev-josias

Copy link
Copy Markdown
Contributor

feat(panel): connect to the device's discovered gRPC port, not a hardcoded 8554

The portable panel always dialed localhost:8554, so it could only ever view
an emulator on the default port. Derive the endpoint from the running device
instead: each running emulator writes a discovery file
(<temp>/avd/running/pid_*.ini) with port.serial + grpc.port, so
AndroidEmulator::grpc_port(serial) looks up the actual port for the device
being viewed. The panel's frame stream, input channel, and screenshot button
now all use that derived endpoint, falling back to 8554 when the serial isn't
known yet (button-launch, pre-boot) or the file is absent.

Effect: an emulator already running on a non-default port when the panel mounts
(it carries its serial from list_all_devices) now connects correctly, and
this lays the groundwork for multiple Android emulators. The single
panel-launched emulator is unchanged (still 8554).

Verified live: AndroidEmulator::grpc_port("emulator-5554") reads the real
discovery file and returns Some(8554); a non-running serial returns None.
Unit test covers the guard paths; build/clippy/fmt clean on Windows.

Follow-up (not here): assign a unique gRPC port at launch so two
panel-launched emulators don't both grab 8554.

…coded 8554

The portable panel always dialed `localhost:8554`, so it could only ever view
an emulator on the default port. Derive the endpoint from the running device
instead: each running emulator writes a discovery file
(`<temp>/avd/running/pid_*.ini`) with `port.serial` + `grpc.port`, so
`AndroidEmulator::grpc_port(serial)` looks up the actual port for the device
being viewed. The panel's frame stream, input channel, and screenshot button
now all use that derived endpoint, falling back to 8554 when the serial isn't
known yet (button-launch, pre-boot) or the file is absent.

Effect: an emulator already running on a non-default port when the panel mounts
(it carries its serial from `list_all_devices`) now connects correctly, and
this lays the groundwork for multiple Android emulators. The single
panel-launched emulator is unchanged (still 8554).

Verified live: `AndroidEmulator::grpc_port("emulator-5554")` reads the real
discovery file and returns `Some(8554)`; a non-running serial returns `None`.
Unit test covers the guard paths; build/clippy/fmt clean on Windows.

Follow-up (not here): assign a unique gRPC port at launch so two
panel-*launched* emulators don't both grab 8554.
@dev-josias
dev-josias merged commit e858102 into main Jul 1, 2026
7 checks passed
dev-josias added a commit that referenced this pull request Jul 1, 2026
- README + docs/index.html: fuller emulator hardware controls
  (Home/Back/Recents/Power, volume, rotate, keyboard, screenshot) and the
  key-free CLI-agent angle (no API key; uses your existing login), plus a
  README bullet for the new chat sessions.
- CLAUDE.md Current status: add a "Landed since #41" summary (input-channel
  reconnect #37, cmd.exe fixes #40/#41, DeviceInfo.serial #44, device-tools MCP
  core #46, AI panel redesign + sessions #48/#52, Volume/Rotate #49, per-device
  gRPC port #51). Device-MCP app wiring is noted as a handed-off follow-up (not
  advertised as shipped since it isn't wired yet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant