React Native未连接到VS Code Debugger

问题描述 投票:0回答:2

我创建了一个新的React Native项目 - 使用react-native init myproject,现在尝试在Visual Studio Code中使用debug。当我点击Debug Android时,我在Android模拟器中收到错误,告诉我它无法连接到远程调试器 - 见下文:enter image description here

在Debug屏幕中,我将必要的配置设置添加到launch.json中 - 见下文。 enter image description here

我还需要做些什么才能在VS Code中调试我的React Native应用程序?

android react-native visual-studio-code
2个回答
0
投票

我使用adb reverse tcp:8081 tcp:8081解决了这个问题,然后使用react-native run android重新加载或重建模拟器


0
投票

尝试:1。禁用Debug Android 2.运行adb reverse tcp:8081 tcp:8081 3.关闭Chrome Debug remote 4.停止并再次运行react-native start --reset-cache,重新加载您的应用程序并等待应用程序启动,然后再次尝试Debug Android

它始终与我合作

© www.soinside.com 2019 - 2024. All rights reserved.