首页 > 解决方案 > Error in VSCode: 'Unable to find adb'. Adb is in the path of my Mac OS Catalina

问题描述

After upgrading to Mac Catalina I can't debug my ionic app anymore ... When I try to debug on device or emulator it gives me this error.

Attaching to android Unable to find adb. Please ensure it is in your PATH and re-open Visual Studio Code

If I do on terminal inside or outside vscode

$adb devices

I get:

List of devices attached
42003f1d9610c50b    device

So adb is in the path.

I even tried to launch VSCode from terminal

code <myFolder>

after doing this: shell command install code

But I still get the same error.

How can I tell VSCode the path to adb?

标签: macosionic-frameworkvisual-studio-codeadbmacos-catalina

解决方案


我设置在 .zshrc

export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"

并在 VS Code 中查看 PATH 环境变量进程上下文。

打开帮助 -> 切换开发者工具 -> 打开控制台 ->

run console.log(process.env.PATH) command

更新后 Catalina 正在工作!


推荐阅读