简体   繁体   English

React native 无法连接远程调试器 ECONNREFUSED

[英]React native Unable to connect with remote debugger ECONNREFUSED

I understand that this has been asked many times before but none of the solutions work for me.我知道这已经被问过很多次了,但是没有一个解决方案对我有用。 Here is the screen grab of my device(android 6.0.1 samsung J210F):这是我的设备(android 6.0.1 samsung J210F)的屏幕截图: 在此处输入图像描述

When I open localhost:8081/debugger-ui I get this message:当我打开 localhost:8081/debugger-ui 时,我收到以下消息: 在此处输入图像描述

So debugger is running on 8081. BUT it gives this message on console:所以调试器在 8081 上运行。但它在控制台上给出了这条消息: 在此处输入图像描述

The reverse tcp command has already been executed by the debugger:调试器已经执行了反向 tcp 命令: 在此处输入图像描述

(The full error that got clipped was Error running 'RN': timeout on waiting for connection to React Native packager. Make sure you have selected 'Debug JS Remotely' from the Developer Menu . I have already selected "Debug JS Remotely" from developer menu so I don't think thats the reason. (被截断的完整错误是Error running 'RN': timeout on waiting for connection to React Native packager. Make sure you have selected 'Debug JS Remotely' from the Developer Menu中选择了“远程调试 JS”。我已经从开发人员中选择了“远程调试 JS”菜单,所以我认为这不是原因。

I hope I provided all the information.我希望我提供了所有信息。 Have been struggling for hours to solve this.一直在努力解决这个问题。

Just run the command adb reverse tcp:8081 tcp:8081 and then run react-native run-android .只需运行命令adb reverse tcp:8081 tcp:8081然后运行react-native run-android The problem would be solved.问题就解决了。

Before enabling remote debugging on your emulator, open http://localhost:8081/debugger-ui in chrome.在模拟器上启用远程调试之前,请在 chrome 中打开http://localhost:8081/debugger-ui Then enable remote debugging and go back to the chrome page where you should see your console logs.然后启用远程调试并返回到您应该看到控制台日志的 chrome 页面。

Reference参考

Just incase anyone comes across this, I ran into this problem and none of the above solutions worked for me.以防万一有人遇到这个问题,我遇到了这个问题,但上述解决方案都不适合我。

I was building my app to my pixel 2 and trying to get chrome debugging working and kept getting this error.我正在为我的像素 2 构建我的应用程序并尝试让 chrome 调试工作并不断收到此错误。

What worked for me: Shake your phone to pull up the RN menu.对我有用的方法:摇动手机以调出 RN 菜单。 Click on dev settings.点击开发设置。 Inside dev settings, click on 'Debug server host & port for device'在开发设置中,单击“设备的调试服务器主机和端口”

here make sure its your machine ip address followed by port 8081. If youre on a mac, you can find your machine ip by going to system preferences --> network --> and under 'status: connected' you will see the IP address info.在这里确保它是你的机器 ip 地址后跟端口 8081。如果你在 mac 上,你可以通过转到系统首选项 --> 网络 --> 找到你的机器 ip,并在“状态:已连接”下你会看到 IP 地址信息。 Make sure your device and mac are on the same wifi network.确保您的设备和 Mac 在同一个 wifi 网络上。

Going back to 'Debug server host & port for device' input '10.0.1.1:8081' (replace 10.0.1.1 with whatever your machine ip was).返回“设备的调试服务器主机和端口”输入“10.0.1.1:8081”(用您的机器 ip 替换 10.0.1.1)。

Reload your build, and then click Debug JS remotely.重新加载您的构建,然后单击“远程调试 JS”。 These steps worked for me.这些步骤对我有用。

If you are trying it on your own device, shake your phone left and right to open the debugger menu.如果您在自己的设备上尝试,请左右摇动手机以打开调试器菜单。 then the error goes away.然后错误消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React-Native build in Visual Studio Code 无法连接远程调试器超时,同时连接到 windows 中的远程调试器 - React-Native build in Visual Studio Code unable to connect with remote debugger timeout while connecting to remote debugger in windows 无法将 Android 模拟器连接到 React Native 调试器 - Unable to connect Android emulator to React Native debugger Android React本机调试显示无法连接远程调试器超时错误 - Android React native debugging shows unable to connect with remote debugger timeout error 无法在Linux中的react-native(android)中的连接问题上与远程调试器连接流的意外结束 - unable to connect with remote debugger unexpected end of stream on connection issue in react-native(android) in linux 无法连接到远程调试器 - Unable to connect to remote debugger 无法连接远程调试器 - Unable to connect with remote debugger React-native 0.21(android)远程调试器(Chrome)无法连接 - React-native 0.21 (android) remote debugger (Chrome) cannot connect 无法在 mac for iOS 应用程序中连接 React native 中的远程调试器? - Not able to connect remote debugger in React native in mac for iOS app? Android模拟器无法连接到React-Native远程调试器-连接时超时 - Android Emulator cannot connect to React-Native remote debugger - Timeout while connecting 无法让 React Native Debugger 在 Ubuntu 中工作:“正在等待 React 连接”消息 - Unable to get React Native Debugger to work in Ubuntu: 'waiting for React to connect' message
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM