我创建了一个新的React Native项目 - 使用react-native init myproject
,现在尝试在Visual Studio Code中使用debug
。当我点击Debug Android
时,我在Android模拟器中收到错误,告诉我它无法连接到远程调试器 - 见下文:
在Debug屏幕中,我将必要的配置设置添加到launch.json
中 - 见下文。
我还需要做些什么才能在VS Code中调试我的React Native应用程序?
我使用adb reverse tcp:8081 tcp:8081
解决了这个问题,然后使用react-native run android
重新加载或重建模拟器
尝试:1。禁用Debug Android
2.运行adb reverse tcp:8081 tcp:8081
3.关闭Chrome Debug remote
4.停止并再次运行react-native start --reset-cache
,重新加载您的应用程序并等待应用程序启动,然后再次尝试Debug Android
。
它始终与我合作