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 //验证环境变量