简体   繁体   English

无法将Debugger与react-native应用程序连接?

[英]Could not connect Debugger with react-native app?

I am trying to add debugger with react native android, But it always stuck on white screen and did not show anything. 我正在尝试添加带有本机android的调试器,但是它始终卡在白屏上,什么也没显示。 After 3 to 5 mint it shows the following message on android:- 3到5分钟后,它在android上显示以下消息:-

Android手机屏幕上显示错误:

and on my visual studio code debugger console it shows:- 在我的Visual Studio代码调试器控制台上,它显示:-

Debbuger控制台显示

and here is my launch.json file:- 这是我的launch.json文件:-

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Attach to packager",
        "program": "${workspaceRoot}/.vscode/launchReactNative.js",
        "type": "reactnative",
        "request": "attach",
        "sourceMaps": true,
        "outDir": "${workspaceRoot}/.vscode/.react"
    },
    {
        "type": "chrome",
        "request": "launch",
        "name": "Launch Chrome against localhost",
        "url": "http://localhost:8080",
        "webRoot": "${workspaceFolder}"
    }
    ]
}

In order to debug JS remotely it is necessary that both the mobile and the laptop to be in the same network then find the ip address of your laptop and then use the following commands 为了远程调试JS,必须将移动设备和便携式计算机都放在同一网络中,然后找到便携式计算机的IP地址,然后使用以下命令

  • adb shell input keyevent 82 亚行外壳输入keyevent 82
  • click in debug host option and enter your ip address there with port like that (eg 192.168.110.2:8081) 单击调试主机选项,然后在其中输入带有类似端口的IP地址(例如192.168.110.2:8081)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM