Mac 安装Flutter环境
安装flutter
//打开环境变量配置
open ~/.bash_profile
//没有创建
touch ~/.bash_profile
//加入下面环境变量
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=[https://storage.flutter-io.cn](https://storage.flutter-io.cn)
//生效
source ~/.bash_profile
git clone [https://git.coding.net/CocoaPods/Specs.git](https://git.coding.net/CocoaPods/Specs.git) ~/.cocoapods/repos/master
//下载安装flutter
git clone -b master [https://github.com/flutter/flutter.git](https://github.com/flutter/flutter.git)
./flutter/bin/flutter --version
//打开环境变量配置
open ~/.bash_profile
//加一行
//`pwd` 安装目录
export PATH**=**"$PATH:`pwd`/flutter/bin"
如
export PATH="$PATH:/Users/admintrator/flutter/bin"
//生效
source ~/.bash_profile
//安装其他(有的就不用安装了)
brew install libimobiledevice ideviceinstaller ios-deploy cocoapods
//检测配置
flutter doctor -v
//出错的根据提示修改
其他
//创建flutter
flutter create flutter_module
//升级
flutter upgrade
//查看环境
flutter channel
//切换环境
flutter channel 环境
//创建插件
flutter create --template=plugin platform_view
本文标题:Mac 安装Flutter环境
本文链接:https://www.haomeiwen.com/subject/czjwjctx.html
网友评论