Mac配置Flutter环境变量
2020-04-14 本文已影响0人
浩仔_Boy
打开终端,输入命令 open ~/.bash_profile,会打开一个bash_profile文件窗口,加上下面配置:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export FLUTTER=/Users/shushi/flutter-sdk/flutter/bin
export PATH=FLUTTER
export PATH="/usr/local/opt/libxml2/bin:$PATH"
其中 export FLUTTER=/Users/shuuhiroshi/flutter-sdk/flutter/bin,为flutter的sdk目录中bin的路径。
ctrl+s保存没关闭
在终端输入source ~/.bash_profile
配置完毕
输入flutter -version,检查配置是否成功