[英]Not able to connect remote debugger in React native in mac for iOS app?
I am trying to debug using chrome.我正在尝试使用 chrome 进行调试。 I have added React Native Tool extension in VSCode, but getting error as:我在 VSCode 中添加了 React Native Tool 扩展,但出现以下错误:
[Error] Error: Unable to find plist file to configure debugging
when I am checking on chrome using http://localhost:8081/debugger-ui/ still not able to connect debugger.当我使用 http://localhost:8081/debugger-ui/ 检查 chrome 时,仍然无法连接调试器。
I am new to react native please suggest if need more information for this issue我是本机反应的新手,如果需要有关此问题的更多信息,请提出建议
Citing the first paragraph from the react-native's site, regarding Chrome Debugging引用来自 react-native 站点的第一段,关于Chrome 调试
To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu.要在 Chrome 中调试 JavaScript 代码,请从开发人员菜单中选择“远程调试 JS”。 This will open a new tab at http://localhost:8081/debugger-ui.这将在 http://localhost:8081/debugger-ui 上打开一个新选项卡。
So technically, in the iOS simulator
, you have to cast the following combination ctrl + cmd + z
, and tap on the Debug JS Remotely
field, which will further open the debugger hosted on the following address http://localhost:8081/debugger-ui
所以从技术上讲,在iOS simulator
,您必须转换以下组合ctrl + cmd + z
,然后点击Debug JS Remotely
字段,这将进一步打开托管在以下地址的调试器http://localhost:8081/debugger-ui
As an workaround, on the same react-native site, there's a page where is explained how to debug the app via a standalone developer tool , which is installed as an npm package
.作为一种解决方法,在同一个 react-native 站点上,有一个页面解释了如何通过独立开发人员工具调试应用程序,该工具作为npm package
安装。
All you have to do is to install the package through npm
or yarn
(choose the package manager which you like the most :] )你所要做的就是通过npm
或yarn
安装包(选择你最喜欢的包管理器 :] )
* the same react-native site recommends to install it globally
npm install -g react-devtools
yarn add global react-devtools
And after installing the package just type in the terminal the following command to open the devtools安装软件包后,只需在终端中输入以下命令即可打开 devtools
react-devtools
您可以在 devtools.dll 的浏览器 url 中使用内部 ip 更改 localhost 值吗?
http://127.0.0.1:8081/debugger-ui/
give a try to complete suit for react native debugging, performance analysis along with latest react-devtools尝试完全适合 React Native 调试、性能分析以及最新的 react-devtools
now it is part of react-native-cli but you can configure in your existing react native version by following现在它是 react-native-cli 的一部分,但您可以按照以下步骤在现有的 react native 版本中进行配置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.