wix/Detox tool tries to launch Android emulator by default, so if there's emulator running already then the error "Running multiple emulators with the same AVD" appears most times (however not always...). Question is, can you configure Detox such way that it would use the emulator running already and not trying to setup new one?
It seems the react-native-firebase team is using Detox this way already, just cannot understand how they manage to do so (see the link below). Could this kind of approach be documented also in the Detox documentation? https://github.com/invertase/react-native-firebase/blob/90b4d7021aff7d5d28140b57eb69283b04712257/.github/workflows/tests_e2e_android.yml#L132-L175
root@df3aaa6b6563:/pwd# nohup $ANDROID_HOME/emulator/emulator -avd "NEXUS_6_API_30" -noaudio -gpu swiftshader_indirect -camera-back none -no-snapshot -no-window -no-boot-anim -nojni -memory 4048 -timezone 'Europe/Helsinki' -cores 4 &
root@df3aaa6b6563:/pwd# yarn e2e-test-android --tags @freepath
yarn run v1.22.19
$ NODE_ENV=ci DETOX_CONFIGURATION=android.emu.debug DETOX_RECORD_LOGS=failing DETOX_HEADLESS=true DETOX_GPU=swiftshader_indirect DETOX_TAKE_SCREENSHOTS=failing DETOX_RECORD_VIDEOS=failing cucumber-js ./e2e/features -f json:e2e/report/cucumber_report.json --require-module ts-node/register --require 'e2e/features/step_definitions/*.ts' --tags @freepath
*** In Cucumber BeforeAll hook for Detox ***
nohup sh -c 'yarn e2e-start' > ./metrobundler.log 0</dev/null &
Running detox.init ...
stdout:
stdout:
stdout:
stdout:
stdout:
stdout:
15:16:14.313 detox[15538] ERROR: [SPAWN_FAIL] `/opt/android/emulator/emulator -verbose -no-audio -no-boot-anim -no-window -gpu swiftshader_indirect -port 11062 @NEXUS_6_API_30` failed with code 1
err: ChildProcessError: `/opt/android/emulator/emulator -verbose -no-audio -no-boot-anim -no-window -gpu swiftshader_indirect -port 11062 @NEXUS_6_API_30` failed with code 1
at ChildProcess.<anonymous> (/pwd/node_modules/child-process-promise/lib/index.js:132:23)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:12)
at maybeClose (internal/child_process.js:1088:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
15:16:14.315 detox[15538] ERROR: [SPAWN_FAIL] ERROR | Running multiple emulators with the same AVD
ERROR | is an experimental feature.
ERROR | Please use -read-only flag to enable this feature.```