运行排毒测试用例时无法识别adb命令

时间:2018-07-10 07:02:07

标签: react-native adb react-native-android android-sdk-tools detox

我正在尝试使用此命令在android中运行排毒测试用例

detox test --configuration android.emu.release --loglevel verbose
我的package.json

中的

配置

"android.emu.release": {
        "binaryPath": "android/app/build/outputs/apk/app-alpha-release.apk",
        "build":
          "cd android && ./gradlew assembleAlphaLocalRelease assembleAndroidTest -DtestBuildType=localRelease && cd ..",
        "type": "android.attached",
        "name": "device"
      }

运行此命令时,出现类似/Android/sdk/tools/platform-tools/adb: No such file or directory

的错误

如果您观察到以上消息,它正在platform-tools文件夹中搜索tools

我可以在系统中正常运行adb devices命令。它没有报告任何此类错误。

可能是什么问题?

环境

react-native : 0.48.4
detox : 6.0.4
detox-cli : 7.4.0

完整输出

node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.release --loglevel verbose


detox-server info 12:17:29: server listening on localhost:51658...
detox verb ws onOpen [object Object]
detox verb ws send: {"type":"login","params":{"sessionId":"bff60a2f-804d-f8db-60a4-4002fc7106da","role":"tester"},"messageId":0}
detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"bff60a2f-804d-f8db-60a4-4002fc7106da","role":"tester"},"messageId":0}
detox verb ws
detox verb 1: /Users/office/Library/Android/sdk:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/office/Library/Android/sdk/platform-tools:/Users/office/.nvm/versions/node/v8.11.1/bin:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools/platform-tools/adb  devices
  1) "before all" hook

  0 passing (146ms)
  1 failing

  1) "before all" hook:
     Error: Command failed: /Users/office/Library/Android/sdk:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/office/Library/Android/sdk/platform-tools:/Users/office/.nvm/versions/node/v8.11.1/bin:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools/platform-tools/adb  devices
/bin/sh: /Users/office/Library/Android/sdk:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/office/Library/Android/sdk/platform-tools:/Users/office/.nvm/versions/node/v8.11.1/bin:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools/platform-tools/adb: No such file or directory
 `/Users/office/Library/Android/sdk:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/office/Library/Android/sdk/platform-tools:/Users/office/.nvm/versions/node/v8.11.1/bin:/Users/office/.fastlane/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/node@6/bin:/Users/office/Library/Android/sdk/tools/platform-tools/adb  devices` (exited with error code 127)
      at callback (node_modules/child-process-promise/lib/index.js:33:27)
      at ChildProcess.exithandler (child_process.js:212:5)
      at maybeClose (internal/child_process.js:899:16)
      at Socket.<anonymous> (internal/child_process.js:342:11)
      at Pipe._handle.close [as _onclose] (net.js:509:12)



child_process.js:524
    throw err;
    ^

Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.release --loglevel verbose
    at checkExecSyncError (child_process.js:481:13)
    at Object.execSync (child_process.js:521:13)
    at runMocha (/Users/office/Desktop/ibc-area-rights/node_modules/detox/local-cli/detox-test.js:61:6)
    at Object.<anonymous> (/Users/office/Desktop/ibc-area-rights/node_modules/detox/local-cli/detox-test.js:39:5)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)

0 个答案:

没有答案