找不到 "react native" 的调试适配器

Cannot find debug adapter to "react native"

为什么我不能 运行 在 android 模拟器上使用 vscode react-native?我在 launch.json:

添加了配置
{"name": "Debug Android",
  "program": "${workspaceRoot}/.vscode/launchReactNative.js",
  "type": "reactnative",
  "request": "launch",
  "platform": "android",
  "sourceMaps": true,
  "outDir": "${workspaceRoot}/.vscode/.react",
  "trace": "verbose"},

运行在模拟器上使用 react-native

第 1 步。从 android studio 中保留模拟器 运行ning。

第 2 步。在项目文件夹中打开终端。

第 3 步。运行react-native run-android

应用程序将在模拟器上启动

运行在设备上响应本机

第 1 步。通过 USB 启用调试

第 2 步。通过 USB 插入设备

第 3 步。检查您的设备是否正确连接到 ADB

List of devices attached
emulator-5554 offline   # Google emulator
14ed2fcc device         # Physical device

在右栏中看到设备表示设备已连接。您一次只能连接一台设备。

步骤 4. 在项目文件夹中打开终端。 第 5 步。运行 您的应用程序

react-native run-android

应用程序将在物理设备上启动

如果您收到 "bridge configuration isn't available" 错误,请参阅 Using adb reverse.