DetoxRuntimeError:无法在设备上运行应用程序

问题描述

尝试使用Detox在Android和iOS模拟器上运行测试时出现问题。已通过Linux和MacOS进行了测试。版本"react-native": "0.63.3","detox": "^17.10.6",和Android设备"avdName": "Pixel_4_API_29",xcode:Version 12.1 simulator

运行React Native Android模拟器时,它可以正常运行,但无法在模拟器中启动该应用程序以进行e2e测试。

端子输出

yarn run v1.22.4
warning ../../../package.json: No license field
$ detox test -c android.emu.release
detox[29872] INFO:  [test.js] configuration="android.emu.release" useCustomLogger=true forceAdbInstall=false DetoX_START_TIMESTAMP=1603969051827 readOnlyEmu=false reportSpecs=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
detox[29883] INFO:  [DetoxServer.js] server listening on localhost:36057...
detox[29883] ERROR: DetoxRuntimeError: Failed to run application on the device

HINT: Most likely,your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process.
detox[29883] INFO:  Welcome is assigned to undefined
detox[29883] INFO:  Welcome: should have welcome screen
detox[29883] INFO:  Welcome: should have welcome screen [SKIPPED]

detox[29883] WARN:  [Client.js/PENDING_REQUESTS] App has not responded to the network requests below:
  (id = -1000) isReady: {}

Unresponded network requests might result in timeout errors in Detox tests.

detox[29872] ERROR: [cli.js] Error: Command Failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e

error Command Failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

detoxrc.json:

{
  "testRunner": "jest","runnerConfig": "e2e/config.json","configurations": {
    "android.emu.debug": {
      "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk","build": "cd android && ./gradlew app:assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..","type": "android.emulator","device": {
        "avdName": "Pixel_4_API_29"
      }
    },"android.emu.release": {
      "binaryPath": "android/app/build/outputs/apk/release/app-release.apk","build": "cd android && ./gradlew app:assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..","device": {
        "avdName": "Pixel_4_API_29"
      }
    }
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)