Flutter安装
2020-03-13 本文已影响0人
吃不胖的瘦子呀
flutter安装 --- Mac环境
- 安装flutter sdk
终端
cd xxx
git clone -b master https://github.com/flutter/flutter.git
./flutter/bin/flutter --version
- 添加国内镜像
open ~/.bash_profile
export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置
export PATH=`xxx`/flutter/bin:$PATH (xxx)为flutter sdk安装地址
如果使用的是zsh,终端启动时 ~/.bash_profile 将不会被加载,解决办法就是修改 ~/.zshrc ,在其中添加:source ~/.bash_profile
- 让环境变量生效
source ~/.bash_profile
- 检测flutter 环境
flutter doctor