2
votes

Detox test -c android.emu.debug

This issue is reporting that it is not finding the device. But device is connected and it is recognised by system. Please any help on this.

Please find package.json file

"detox": { "configurations": { "android.emu.debug": { "binaryPath": "android/app/build/outputs/apk/staging/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..", "type": "android.attached", "device": { "avdName": "56149225" } }, "android.emu.release": { "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..", "type": "android.emulator", "device": { "avdName": "56149225" } } } }

Log

detox[16824] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR] 
 DetoxRuntimeError: DetoxRuntimeError: Could not find 'undefined' on the currently ADB attached devices:

HINT: Make sure your device is connected.
You can also try restarting adb with 'adb kill-server && adb start-server'.

List of devices attached
56149225        device


    at AttachedAndroidDriver.acquireFreeDevice (/home/yajana/Documents/Detox/examples/mobile-client/node_modules/detox/src/devices/drivers/AttachedAndroidDriver.js:21:13)
    at async Device.prepare (/home/yajana/Documents/Detox/examples/mobile-client/node_modules/detox/src/devices/Device.js:20:22)
    at async Detox.init (/home/yajana/Documents/Detox/examples/mobile-client/node_modules/detox/src/Detox.js:72:5)
    at async Function._initializeInstance (/home/yajana/Documents/Detox/examples/mobile-client/node_modules/detox/src/DetoxExportWrapper.js:81:7)
    at async DetoxExportWrapper.init (/home/yajana/Documents/Detox/examples/mobile-client/node_modules/detox/src/DetoxExportWrapper.js:32:20)
    at async Context.<anonymous> (/home/yajana/Documents/Detox/examples/mobile-client/e2e/init.js:6:3)
  1) "before all" hook in "{root}"

  0 passing (39ms)
  1 failing

  1) "before all" hook in "{root}":
     Error: DetoxRuntimeError: Could not find 'undefined' on the currently ADB attached devices:

HINT: Make sure your device is connected.
You can also try restarting adb with 'adb kill-server && adb start-server'.

List of devices attached
56149225        device


      at AttachedAndroidDriver.acquireFreeDevice (node_modules/detox/src/devices/drivers/AttachedAndroidDriver.js:21:13)
      at async Device.prepare (node_modules/detox/src/devices/Device.js:20:22)
      at async Detox.init (node_modules/detox/src/Detox.js:72:5)
      at async Function._initializeInstance (node_modules/detox/src/DetoxExportWrapper.js:81:7)
      at async DetoxExportWrapper.init (node_modules/detox/src/DetoxExportWrapper.js:32:20)
      at async Context.<anonymous> (e2e/init.js:6:3)



detox[16816] ERROR: [cli.js] Error: Command failed: node_modules/.bin/mocha --opts e2e/mocha.opts --configuration android.emu.debug --grep :ios: --invert "e2e"
1

1 Answers

-1
votes

Try "adbName" : <your-device-name> instead of "avdName".