Skip to content

fix(emulator): macOS gRPC token auth — right discovery dir + wire the native view - #83

Merged
dev-josias merged 1 commit into
mainfrom
fix/macos-grpc-token-discovery
Jul 3, 2026
Merged

fix(emulator): macOS gRPC token auth — right discovery dir + wire the native view#83
dev-josias merged 1 commit into
mainfrom
fix/macos-grpc-token-discovery

Conversation

@dev-josias

Copy link
Copy Markdown
Contributor

Completes #81's gRPC token auth on macOS, so the native emulator panel streams emulators launched outside UMIDE (Android Studio, or emulator with no -grpc). Two macOS gaps, both found by live-testing on a real Pixel_9a:

1. Discovery directory (android.rs) — the macOS-specific bug Windows couldn't catch. The emulator writes its avd/running/pid_*.ini (with grpc.port + grpc.token) to ~/Library/Caches/TemporaryItems on macOS, not $TMPDIR (what std::env::temp_dir() returns). grpc_discovery searched only $TMPDIR, so on macOS it never found the token. Now searches the macOS Caches path first, $TMPDIR as fallback — cfg-gated, so Windows/Linux are unchanged.

2. Native-view wiring (native_view.rs + emulator_view.rs) — start_grpc_stream passed None to both connect_with_retry calls (Windows left the NOTE). It now takes the token, and the macOS panel resolves it from the device serial via grpc_discovery, mirroring the portable path's endpoint_for.

Live-proven on macOS (examples/token_grab, external token-mode Pixel_9a)

discovery: serial=emulator-5554 port=8554 token=present
NO-TOKEN:  rejected as expected -> Unauthenticated
WITH-TOKEN: got frame 1080x2424 (10471680 bytes) — WORKS

UMIDE-launched emulators (explicit -grpc, no token) are unchanged. Unblocks the beta on all three platforms.

… native view

Completes #81's gRPC token auth on macOS, so the native emulator panel streams
emulators launched OUTSIDE UMIDE (Android Studio, or `emulator` with no -grpc).
Two macOS gaps, both found by live-testing on a real Pixel_9a:

1. Discovery directory (android.rs): the emulator writes its
   avd/running/pid_*.ini — with grpc.port + grpc.token — to
   ~/Library/Caches/TemporaryItems on macOS, NOT $TMPDIR (what
   std::env::temp_dir() returns). grpc_discovery searched only $TMPDIR, so on
   macOS it never found the token. Now searches the macOS Caches path first,
   $TMPDIR as fallback (cfg-gated — Windows/Linux behaviour unchanged).

2. Native-view wiring (native_view.rs + emulator_view.rs): start_grpc_stream
   took no token and passed None to both connect_with_retry calls (Windows left
   the NOTE). It now takes the token and the macOS panel resolves it from the
   device serial via grpc_discovery — mirroring the portable path's endpoint_for.

Live-proven on macOS (examples/token_grab, external token-mode Pixel_9a): a call
WITHOUT the token is rejected (Unauthenticated); WITH it a real 1080x2424 frame
streams. UMIDE-launched emulators (explicit -grpc, no token) are unchanged.
@dev-josias
dev-josias merged commit 434e506 into main Jul 3, 2026
7 checks passed
@dev-josias
dev-josias deleted the fix/macos-grpc-token-discovery branch July 3, 2026 20:06
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