https://blog.csdn.net/ytfunnysite/article/details/81070066git
cd ~
touch .bash_profile
open -e .bash_profile
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
source .bash_profile
echo $PATH
export ANDROID_HOME=/program/sdk export PATH=${PATH}:${ANDROID_HOME}/platform-tools export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/build-tools/28.0.3
flutter channel
flutter channel stable
flutter --version flutter upgrade
若是沒有在線下載,而是使用的官方壓縮包,能夠經過.zshrc配置環境變量github
cd ~ touch .zshrc open -e .zshrc
打開.zshrc 後配置解壓的flutter路徑 export PATH="$PATH:/Library/flutter/bin"保存後刷新配置bash
source $HOME/.zshrc echo $PATH //驗證環境變量