RN Android "unabled to conn

作者: 我的名字违规了 | 来源:发表于2019-04-18 11:37 被阅读0次

React Native开发过程中,在Android模拟器上,commond + m,选择Debug Js Remotely,模拟器卡在connecting to remote debugger,或者报错提醒unabled to connect with remote debugger

解决方法

  1. 设置链接地址

    commond + m-->Dev Setting-->Debug server host & post for device

    输入ip和端口号,如:127.0.0.1:8081

  2. 命令行设置模拟器映射端口

    adb reverse tcp:8081 tcp:8081

  3. 以上设置完成,再执行Debug Js Remotely,就可以链接debbger,但是会存在跨域问题。两种解决方案

    • 完全退出chrome,命令行执行
    open -a "Google Chrome" --args --disable-web-security  --user-data-dir
    
    • 下载chrome浏览器插件 Allow-Control-Allow-Origin,安装之后,开启跨域模式。

相关文章

网友评论

    本文标题:RN Android "unabled to conn

    本文链接:https://www.haomeiwen.com/subject/fjdzwqtx.html