从设备反应原生的Chrome调试被破坏了吗? (运行时尚未准备好进行调试)

时间:2016-03-31 13:31:38

标签: google-chrome npm react-native

有人可以建议检查设备上的Chrome调试吗? Chrome调试可以很好地调试iOS模拟器。

iOS设备的Chrome调试已经运行了一个多月,直到它在大约一周前停止工作。

我花了好几天时间尝试让Chrome调试再次运行。我甚至开始了全新的#34; AwesomeProject"。没有运气。

Chrome Debug URL是否保持相同以调试设备和模拟器?

enter image description here

使用OS X 10.11.3,Xcode 7.3,iOS 9.3和react-native 0.22

  • MacBook WiFi:173.17.29.213
  • iPad WiFi:173.17.29.77
  • 我可以从MacBook ping iPad。
  • 我可以在iPad上运行AwesomeProject并启用实时重新加载。
  • 当jsCodeLocation设置为localhost
  • 时,我可以在模拟器中正常调试
  • 我杀了Chrome并重启了它,打开了http://localhost:8081/debugger-ui
  • React Packager正在运行
  • 我可以设置Xcode断点

文件:AppDelegate.m

  jsCodeLocation = [NSURL URLWithString:@"http://173.17.29.213:8081/index.ios.bundle?platform=ios&dev=true"];

Xcode调试控制台显示:

2016-03-31 08:02:12.286 [error][tid:com.facebook.react.RCTBridgeQueue][RCTWebSocketExecutor.m:85] Runtime is not ready for debugging.
 - Make sure Packager server is running.
- Make sure Chrome is running and not paused on a breakpoint or exception and try reloading again.
2016-03-31 08:02:12.319 [error][tid:main][RCTWebSocketExecutor.m:132] WebSocket connection failed with error Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"
2016-03-31 08:02:12.513 [fatal][tid:main] Runtime is not ready for debugging. Make sure Packager server is running.
2016-03-31 08:02:36.032 [error][tid:main][RCTWebSocketExecutor.m:132] WebSocket connection failed with error Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"
2016-03-31 08:02:36.032 [error][tid:com.facebook.react.RCTBridgeQueue][RCTWebSocketExecutor.m:85] Runtime is not ready for debugging.
 - Make sure Packager server is running.
- Make sure Chrome is running and not paused on a breakpoint or exception and try reloading again.
2016-03-31 08:02:36.707 [fatal][tid:main] Runtime is not ready for debugging. Make sure Packager server is running.

文件:package.json

{
  "name": "AwesomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react": "^0.14.8",
    "react-native": "^0.22.2"
  }
}

1 个答案:

答案 0 :(得分:15)

在面对确切的情况之后,你又向我迈出了一步,并为我工作:

"要在真实设备上进行调试:

在iOS上 - 打开文件RCTWebSocketExecutor.m并将localhost更改为您计算机的IP地址。摇动设备以打开开发菜单,并选择开始调试。 [1]"

[1] https://facebook.github.io/react-native/docs/debugging.html