macos - 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?
解决方案
我设置在 .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 正在工作!
推荐阅读
- flutter - 如何模拟未来的方法而不是获取类型'Null'不是颤振中类型'Future<>'的子类型
- android - 需要将 App Store 链接添加到 Admob 帐户吗?
- java - 如何找到调试 SHA 1 密钥
- php - 发布数组 Laravel 8 - 返回为 NULL 的值
- python - 从列表内的字典中检索值,在字典内
- javascript - 如果列数据在 Bulletd 列表(数组)中,如何从 kendo Ui 网格中过滤记录
- laravel - laravel api 显示错误目标类在生产中不存在(cpanel)
- c# - ASP.NET Core blazor 依赖注入错误:System.NullReferenceException?
- google-cloud-platform - 在 GKE 中,如何使用负载均衡器最小化连接时间
- node.js - Heroku REST API 不工作但在本地工作