android - 执行 Detox 测试命令后出现 DetoxRuntimeError
问题描述
Detox test -c android.emu.debug
此问题报告它没有找到该设备。但是设备已连接并且被系统识别。请对此提供任何帮助。
请找到 package.json 文件
“detox”:{“配置”:{“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 ..", "类型”:“机器人。模拟器”,“设备”:{“avdName”:“56149225”}}}}
日志
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"
解决方案
尝试"adbName" : <your-device-name>
代替"avdName"
.
推荐阅读
- kotlin - Kotlin 中“For 循环”中 Thread.Sleep() 的替代方案?
- javascript - 每次访问与模式匹配的 url 时,在 chrome 扩展的后台脚本中添加一个监听器到 webNavigation
- graphql - 使用 Apollo GraphQl 的待办事项列表乐观订阅更新
- r - 频率值作为颜色变量的热图
- r - 在 R 中对数据集进行多重相关的循环
- python - Pandas.plot 不会绘制 Series 对象的所有行
- github-pages - Hugo 站点托管在 GitHub Pages 中。主页显示正常,但博客转到 404
- android - Android Webview:页面加载时显示图像
- azure - mavenAuthenticateFeed 在 Azure DevOps MavenTask 中做了什么?
- python - 将带有 K:V 的 3 列 excel 转置为 Pandas 列