fix(platform-android): avoid probing physical devices as emulators#112
Open
kateinoigakukun wants to merge 1 commit intocallstackincubator:mainfrom
Open
Conversation
## Description Fix Android emulator device resolution to skip non-emulator ADB IDs before querying AVD name, preventing harness runs from failing when both physical devices and emulators are connected. Also adds a focused regression test suite for mixed-device scenarios and introduces package-local Vite test config so nx test works for platform-android. ## Related Issue No upstream issue link available in this branch context. The bug was reproduced from downstream integration usage where a connected physical device caused adb -s <serial> emu avd name to fail during emulator resolution. ## Context getAdbId iterated all IDs from adb devices and called getEmulatorName for emulator-configured runs regardless of ID type. On physical devices this command is invalid and throws. The fix filters IDs to emulator-* before calling getEmulatorName, preserving existing matching behavior while avoiding false failures. The regression tests intentionally use generic device serials and model names to avoid personal/local identifiers in upstream tests. ## Testing - pnpm nx lint @react-native-harness/platform-android (pass) - pnpm nx typecheck @react-native-harness/platform-android (pass) - pnpm nx test @react-native-harness/platform-android -- --run src/__tests__/adb-id.test.ts (pass) - Full target run currently has unrelated pre-existing failures in app-monitor.test.ts in this repo state
|
@kateinoigakukun is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
When we specify an android emulator as the harness runner like below and connect a physical device, we get the following error.
This is just because
getAdbIdtries to get an emulator name from a physical device.This patch fixes Android emulator device resolution to skip non-emulator ADB IDs before querying AVD name. Also adds a focused regression test suite.
Testing
I manually tested with that previously problematic situation.