Repository navigation
fix(android): open emulators reliably in the panel - #11
Merged
Merged
Conversation
An emulator restored from a quick-boot snapshot can stay unauthorized because adb does not repeat the key exchange, so the panel waited out the boot timeout and listed the bare serial next to the stopped AVD. Name emulators through the console in every adb state, and reconnect the adb transport at most every 5 seconds while an AVD boots or after selecting a running emulator. Both paths share one readiness check that waits for authorization and sys.boot_completed. Count reconnects.
The build copies runtimes/serve-emu/node_modules into the package. A checkout that last ran vendor:serve-emu before the Node.js runtime change shipped without ws, so the Android backend exited on start. Compare npm's installed lockfile with package-lock.json and stop with a vendor:serve-emu hint when they differ.
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.
Summary
Fixes two problems that stopped the Android emulator from opening in the panel.
unauthorized: an emulator restored from a quick-boot snapshot can come up with adb marking itunauthorized, and adb never checks again. The panel waited out the two-minute boot limit without showing a usable device. Because the AVD name was only read for authorized devices, the dropdown also listed a bareemulator-5554next to the same AVD shown as stopped. Selecting that entry failed straight away.adb reconnectfor an unauthorized emulator, at most every 5 s. Selecting a running emulator waits up to 15 s and then explains how to recover.sys.boot_completedis1.ws: the build copiesruntimes/serve-emu/node_modulesinto the package. A checkout that last rannpm run vendor:serve-emubefore the Node.js runtime change (740a6ea) packaged a stale folder withoutws, and the Android backend exited on start withERR_MODULE_NOT_FOUND. The build now compares npm's record of installed packages withpackage-lock.jsonand stops with avendor:serve-emuhint when they differ.The final commit bumps the version to 0.1.140.
Telemetry
New
android.emulator.adb_reconnectscount with a fixedtrigger(bootorselection), on the simulator surface with Android emulator context. It sends no serials, AVD names or adb output. Documented indocs/telemetry.md. Existing Android startup diagnostics and MCP tool errors still cover boot outcomes.Testing
vendor:serve-emuinstall and fails on a stale installed lockfile with the hint.npm test: 612 of 614 pass. The Android CLI tests that failed locally before now pass, since they neededws.tests/public-release.test.tsfails because this checkout's rootnode_moduleslacks@commitlint/cli.adb reconnectfixed a real stuckunauthorizedstate.Medium_Phone_API_36.1as running.serve-emuwith fresh dependencies started and streamed through scrcpy.