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

Android emulator auto-select #3699

Open
d4vidi opened this issue Nov 13, 2022 · 1 comment
Open

Android emulator auto-select #3699

d4vidi opened this issue Nov 13, 2022 · 1 comment

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Nov 13, 2022

Describe your idea

For the Google emulators case, which is the common case when using Detox (on Android), it is mandatory for the onboarding developer to run adb devices / check Android Studio / dig into the SaaS machine's setup in order to select the emulator Detox should run on. While more fail-proof, as a process, it is a bit clunky and probably helps over-complicate the already complex setup flow.

My proposal is that initially, Detox would be integrated (e.g. using detox init) such that the device to use would be in a special mode called auto - which would tell Detox to auot-select an emulator*, based on some logic:

"devices": {
  "android": {
    "type": "android.emulator",
    "device": {
+      "avdName": "auto",
    }
  }
}

Or, in a way, slightly more idiomatic:

"devices": {
  "android": {
    "type": "android.emulator",
+    "name": "auto",
  }
}

Alternatively, the default behavior could be selected in response to not having avd-name specifics in the configuration, so as to ease even further both the developer and our config parsing logic.

"devices": {
  "android": {
    "type": "android.emulator",
-    "device": {
-      "avdName": "auto"
-    }
  }
}

==> Implies 'auto'

This will have to come with a cost elsewhere, of course:

  • Have detox test warn that an emulator has been auto-selected, explaining why (link to troubleshooting guide / setup section) and which specific emulator it chose.
  • Extend the onboarding guide and detox init such that it would allow for modifying the emulator at a later step. For the detox init case - have it propose to do so interactively (i.e. have it run adb devices behind the scenes and prompt the user for a device selection, etc.).

* BTW, this is how Android (native) instrumentation testing works.

@GiovaniBiagi
Copy link

Any update on this point? I'm developing a small CLI to give the user the power to select available virtual devices. It's not a very pretty solution but it will have to be that way for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants