feat(panel): connect to the device's discovered gRPC port (not hardcoded 8554) - #51
Merged
Conversation
…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
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viewan 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) withport.serial+grpc.port, soAndroidEmulator::grpc_port(serial)looks up the actual port for the devicebeing 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, andthis 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 realdiscovery file and returns
Some(8554); a non-running serial returnsNone.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.