Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Filter extra avd info when listing emulators #27497

Merged
merged 3 commits into from Mar 8, 2024

Conversation

gabrieldonadel
Copy link
Member

Why

Recently got a few reports from @brentvatne and @Simek regarding a non bootable device being listed in Orbit

Check image

image

After doing some testing this same bug also applies to expo-cli

yarn expo run:android
yarn run v1.22.21
$ /Users/brent/code/microfoam/node_modules/.bin/expo run:android
✔ Created native directory
✔ Updated package.json | no changes
✔ Finished prebuild
› Opening emulator INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
Error: The emulator (INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192) quit before it finished opening. You can try starting the emulator manually from the terminal with: /Users/brent/Library/Android/sdk/emulator/emulator @INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
Error: The emulator (INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192) quit before it finished opening. You can try starting the emulator manually from the terminal with: /Users/brent/Library/Android/sdk/emulator/emulator @INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
    at stopWaitingAndReject (/Users/brent/code/microfoam/node_modules/@expo/cli/build/src/start/platforms/android/emulator.js:110:20)
    at ChildProcess.<anonymous> (/Users/brent/code/microfoam/node_modules/@expo/cli/build/src/start/platforms/android/emulator.js:121:13)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How

AVD IDs cannot contain spaces, so in order to remove all the extra info returned by emulator -list-avds, we can just filter out lines that contain spaces

Test Plan

Running yarn expo run:android -d should not list INFO | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92342 (emulator) as an option to launch

Checklist

@byCedric
Copy link
Member

byCedric commented Mar 8, 2024

Related: #27473

@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 8, 2024
@gabrieldonadel gabrieldonadel merged commit 5bd5d16 into main Mar 8, 2024
6 checks passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/fix-listing-emulators branch March 8, 2024 16:20
gabrieldonadel added a commit that referenced this pull request Mar 13, 2024
Recently got a few reports from @brentvatne and @Simek regarding a non
bootable device being listed in Orbit
<details>
<summary>Check image</summary>

![image](https://github.com/expo/expo/assets/11707729/12301bbe-5442-4e13-807f-26654349526a)

</details>

After doing some testing this same bug also applies to expo-cli

```
yarn expo run:android
yarn run v1.22.21
$ /Users/brent/code/microfoam/node_modules/.bin/expo run:android
✔ Created native directory
✔ Updated package.json | no changes
✔ Finished prebuild
› Opening emulator INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
Error: The emulator (INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192) quit before it finished opening. You can try starting the emulator manually from the terminal with: /Users/brent/Library/Android/sdk/emulator/emulator @INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
Error: The emulator (INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192) quit before it finished opening. You can try starting the emulator manually from the terminal with: /Users/brent/Library/Android/sdk/emulator/emulator @INFO    | Storing crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is enabled for process: 92192
    at stopWaitingAndReject (/Users/brent/code/microfoam/node_modules/@expo/cli/build/src/start/platforms/android/emulator.js:110:20)
    at ChildProcess.<anonymous> (/Users/brent/code/microfoam/node_modules/@expo/cli/build/src/start/platforms/android/emulator.js:121:13)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

AVD IDs cannot contain spaces, so in order to remove all the extra info
returned by `emulator -list-avds`, we can just filter out lines that
contain spaces

Running `yarn expo run:android -d` should not list ` INFO | Storing
crashdata in: /tmp/android-brent/emu-crash-34.1.18.db, detection is
enabled for process: 92342 (emulator)` as an option to launch

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants