1,關(guān)于zsh ,請移步介紹:終極 Shell——ZSH
官網(wǎng) :oh-my-zsh
2,安裝完zsh,在使用相關(guān)shell命令,出現(xiàn)了”zsh: command not found adb:adb”,”zsh: command not found: git” 等一系列error
這里寫圖片描述
字面意思是相關(guān)命令沒有沒有找到
其實(shí)就是bash shell 以及zsh shell 是兩種讀取系統(tǒng)環(huán)境變量
(使用adb的前提是你肯定已經(jīng)在bash的 .bash_profile 已經(jīng)配置相關(guān)android tool的環(huán)境變量了,從而才能使用adb命令)
然而在使用zsh shell的時(shí)候,你并沒有把相關(guān)的環(huán)境變量的配置設(shè)置到 .zshrc 中(功能上類似bash 的.bash_profile)
3,解決辦法
既然是.zshrc 沒有配置相關(guān)環(huán)境變量設(shè)置,把 bash 中.bash_profile 全部環(huán)境變量加入就好
open .zshrc
然后找到# User configuration部分,添加
source ~/.bash_profile
這里寫圖片描述
執(zhí)行
source .zshrc
在運(yùn)行adb 命令
這里寫圖片描述
成功執(zhí)行