无法在iOS模拟器中启动Chrome DevTools ?

[英]Can't launch Chrome DevTools in iOS simulator


Using v8.2 simulator, Cmd+D always show the following error message

使用v8.2模拟器,Cmd+D总是显示以下错误消息。

[RCTLog][tid:0x7fcc2bf4cb90][RCTRootView.m:68]>WebSocket debugger is not available. Did you forget to include RCTWebSocketExecutor?

2 个解决方案

#1


4  

Finally, I found the root cause after I tried many different way to solve this problem.

最后,在尝试了许多不同的方法来解决这个问题之后,我找到了根源。

For using Chrome DevTool to debug, iOS project need to import libraries RCTWebSocketDebugger.xcodeproj and libicucore.dylib.

为了使用Chrome DevTool调试,iOS项目需要导入库RCTWebSocketDebugger。xcodeproj libicucore.dylib。

In react-native examples, 2048, Movies, TicTacToe doesn't import these two libraries. That's why it always show error message "WebSocket debugger is not available. Did you forget to include RCTWebSocketExecutor?" in console.

在实例中,2048,电影,TicTacToe并没有导入这两个库。这就是为什么它总是显示错误消息“WebSocket调试器不可用。您是否忘记在控制台中包含RCTWebSocketExecutor?

enter image description here

  1. press + > Add Other... > <REACT_NATIVE_ROOT>/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj
  2. 按+ >添加其他…> < REACT_NATIVE_ROOT > /图书馆/ RCTWebSocketDebugger / RCTWebSocketDebugger.xcodeproj
  3. press + > search RCTWebSocketDebugger.a > Add
  4. 按+ >搜索RCTWebSocketDebugger。>添加
  5. press + > search libicucore.dylib > Add
  6. 按+ >搜索libicucore。dylib >添加
  7. press ⌘ + R in Xcode to run the project
  8. 按⌘+ R在Xcode中运行这个项目
  9. open Chrome URL http://localhost:8081/debugger-ui
  10. 开放Chrome URL http://localhost:8081 / debugger-ui
  11. press ⌘ + D in iOS Simulator to enable debugging
  12. 按⌘+ D iOS模拟器启用调试

#2


0  

Possibly similar to this issue:

可能与这个问题相似:

https://github.com/facebook/react-native/issues/311

https://github.com/facebook/react-native/issues/311

And also mentioned here:

这里还提到:

https://github.com/facebook/react-native/issues/297

https://github.com/facebook/react-native/issues/297

Looks like it's probably a poor error message for the fact that React Native is unable to connect to the Chrome Debugger. The first link has a possible fix:

看起来这可能是一个糟糕的错误消息,因为响应本机无法连接到Chrome调试器。第一个环节有一个可能的解决方案:

In RCTWebSocketExecutor.m:
- (instancetype)init
{
return [self initWithURL:[NSURL URLWithString:@"http://localhost:8081/debugger-proxy"]];
}

This prevents remote debugging. If I manually change it to my computer's IP, I am able to debug with the Chrome inspector.

这可以防止远程调试。如果我手动将它更改为我的计算机的IP,我就可以与Chrome检查器进行调试。

Credit to https://github.com/ckknight if it works :)

如果成功的话,可以使用https://github.com/ckknight。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2015/03/28/2d357862981325c2d8c0fb5c36a4ad04.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号