MacOS Catalina 10.15.4 痴荐,在Android Studio的 Terminal中使用flutter的命令失效橘茉, 提示 zsh: command not found: flutter
據(jù)官方說,從 macOS Catalina 版開始昂勉,您的 Mac 將使用 zsh 作為默認(rèn)登錄 Shell 和交互式 Shell者甲。您還可以在較低版本的 macOS 中將 zsh 設(shè)置為默認(rèn) Shell商佛。
永久解決方法
1闷愤、執(zhí)行:【open ~/.zshrc 】
open ~/.zshrc
2 整葡、如果 提示文件不存在,則執(zhí)行:【vim ~/.zshrc 】新建一個(gè)新文件肝谭。
vim ~/.zshrc
3 掘宪、再執(zhí)行【open ~/.bash_profile 】
open ~/.bash_profile
4 蛾扇、把 bash_profile 中的內(nèi)容copy到 zshrc 文件中攘烛,保存:【:wq回車】。
5 镀首、再使用source命令重新加載一下:【source ~/.zshrc】,下次再編輯這個(gè)文件就可以直接執(zhí)行:【open ~/.zshrc】
source ~/.zshrc
6 坟漱、運(yùn)行【flutter -h 】看生效沒有
生效后就可以在Terminal中執(zhí)行flutter 命令了.