React Native 无法连接远程调试器 ECONNREFUSED [英] React native Unable to connect with remote debugger ECONNREFUSED

查看:91
本文介绍了React Native 无法连接远程调试器 ECONNREFUSED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道之前已经多次询问过这个问题,但没有一个解决方案适合我.这是我的设备(android 6.0.1 samsung J210F)的屏幕截图:

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):

当我打开 localhost:8081/debugger-ui 时,我收到以下消息:

When I open localhost:8081/debugger-ui I get this message:

所以调试器在 8081 上运行.但是它在控制台上给出了这个消息:

So debugger is running on 8081. BUT it gives this message on console:

反向tcp命令已经被调试器执行了:

The reverse tcp command has already been executed by the debugger:

(被剪掉的完整错误是Error running 'RN': timeout on waiting for connection to React Native packager.确保您已从开发人员菜单中选择了Debug JS Remotely".我已经选择了Debug JS Remotely"来自开发者菜单,所以我认为这不是原因.

(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.

我希望我提供了所有信息.为解决这个问题苦苦挣扎了几个小时.

I hope I provided all the information. Have been struggling for hours to solve this.

推荐答案

只需运行命令 adb reverse tcp:8081 tcp:8081 然后运行 ​​react-native run-android.问题就解决了.

Just run the command adb reverse tcp:8081 tcp:8081 and then run react-native run-android. The problem would be solved.

这篇关于React Native 无法连接远程调试器 ECONNREFUSED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆