react-native - 'adb' 未被识别为内部或外部命令

react-native - 'adb' is not recognized as an internal or external command

这是我的第一个 React Native 设置。我开始使用 react-native run android 构建并收到 BUILD SUCCESSFUL in 4m 7s 消息。

然后 CLI 脚本尝试了:

info Connecting to the development server...

warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...

'adb' is not recognized as an internal or external command,
operable program or batch file.

error Failed to start the app.

Error: Command failed: adb shell am start -n com.notez/com.notez.MainActivity
at makeError (S:\Projects (my)\notez\node_modules\execa\index.js:174:9)  
    at Function.module.exports.sync (S:\Projects (my)\notez\node_modules\execa\index.js:338:15)

但我已经解决了一切。 ADB 和 SDK 路径在我的 OS ENV 配置中定义。

所以我尝试在另一个控制台上执行上面失败的代码:

adb shell am start -n com.notez/com.notez.MainActivity

然后成功了!如何将 'adb' 定义为错误所指的内部或外部命令?

我将环境变量 ANDROID_HOME 的值从 C:\Users\User\AppData\Local\Android\Sdk\ 更改为 C:\Users\User\AppData\Local\Android\Sdk\platform-tools\ 并且有效...