❓ 提示 adb 不是内部或外部命令

← 返回问题清单
症状:终端执行 adb 报错:'adb' 不是内部或外部命令 / command not found。
1

安装 platform-tools

Google 官网下载 Sdk Platform-Tools for Windows(zip),解压到固定目录如 D:\platform-tools,里面有 adb.exe。

brew install --cask android-platform-tools;或下载 platform-tools 解压取 adb。

sudo apt install adb / sudo dnf install android-tools。

2

加入 PATH 环境变量

sysdm.cpl → 高级 → 环境变量 → 用户变量 Path → 新建 → 填 platform-tools 目录 → 确定,重开所有终端窗口。

$ echo 'export PATH="$PATH:/path/to/platform-tools"' >> ~/.zshrc
$ source ~/.zshrc
$ echo 'export PATH="$PATH:/path/to/platform-tools"' >> ~/.bashrc
$ source ~/.bashrc
3

验证

$ adb version
Android Debug Bridge version 1.0.41
$ adb devices -l
其他问题快速跳转