排毒Android命令失败。

时间:2018-10-15 03:32:28

标签: android react-native detox

我已经创建了一个Detox Android基础项目, 发生“命令失败”。 仿真器没有响应。 有人有相同的症状吗?

每个Package.json和控制台日志内容如下。

Package.json

{
  "name": "detoxExample",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "detox-server": "detox run-server",
    "clean": "react-native start --reset-cache",
    "e2e:ios": "detox test --configuration ios.sim.debug --debug-synchronization --record-videos nonex ",
    "e2e:android": "detox test --configuration android.emu.debug --record-videos  none"
  },
  "dependencies": {
    "react": "16.5.0",
    "react-native": "0.57.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "detox": "9.0.4",
    "metro-react-native-babel-preset": "0.45.2",
    "mocha": "^5.2.0",
    "react-test-renderer": "16.5.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/detoxExample.app",
        "build": "xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone 6"
      },
      "android.emu.debug": {
        "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
        "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
        "type": "android.emulator",
        "name": "Nexus_5X_API_27"
      }
    },
    "test-runner": "mocha",
    "runner-config": "e2e/mocha.opts"
  }
}

控制台日志

detox[59629] INFO:  [DetoxServer.js] server listening on localhost:62745...
  1) "before all" hook

  0 passing (2m)
  1 failing

  1) "before all" hook:
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

child_process.js:644
    throw err;
    ^

Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug      --grep :ios: --invert    --record-videos none --artifacts-location "artifacts/android.emu.debug.2018-10-15 03-17-01Z" 
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at runMocha (/Users/{UserName}/detoxExample/node_modules/detox/local-cli/detox-test.js:129:6)
    at run (/Users/{UserName}/detoxExample/node_modules/detox/local-cli/detox-test.js:82:7)
    at Object.<anonymous> (/Users/{UserName}/detoxExample/node_modules/detox/local-cli/detox-test.js:217:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

如果您给我一个答案,我认为不胜感激。

0 个答案:

没有答案