一.Flutter下载与配置
1.你可以直接去官网git下载zip(GitHub - flutter/flutter at 2.10.5)?我是M芯片所以直接去的这里下载在 macOS 上安装和配置 Flutter 开发环境 | Flutter 中文文档 | Flutter 中文开发者网站
2.解压配置环境变量和flutter pub数据源
2.1.基础环境配置
export PUB_HOSTED_URL="https://mirrors.cloud.tencent.com/dart-pub"
export FLUTTER_STORAGE_BASE_URL="https://mirrors.cloud.tencent.com/flutter"
FLUTTER_HOME="/Library/Flutter/flutter"
export FLUTTER_HOME
PATH="$PUB_HOSTED_URL:$FLUTTER_STORAGE_BASE_URL:$FLUTTER_HOME/bin:$PATH"
2.2.其他pub源参考
清华
export FLUTTER_STORAGE_BASE_URL=https://mirrors.tuna.tsinghua.edu.cn/flutter
export PUB_HOSTED_URL=https://mirrors.tuna.tsinghua.edu.cn/dart-pub
交大
export PUB_HOSTED_URL=https://dart-pub.mirrors.sjtug.sjtu.edu.cn
export FLUTTER_STORAGE_BASE_URL=https://mirrors.sjtug.sjtu.edu.cn
CNNIC
export PUB_HOSTED_URL=http://mirrors.cnnic.cn/dart-pub
export FLUTTER_STORAGE_BASE_URL=http://mirrors.cnnic.cn/flutter
二.Mac配置
1.appstore中搜索安装Xcode
2.安装Homebrew并更新
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
3.安装物理机打包所需的环境(终端鼠标中键--->选项--->在访达中显示--->终端鼠标右键---显示简介--->使用Rosetta打开勾选起--->打开终端依次输入命令)
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
sudo gem install cocoapods?
sudo gem install ffi
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer?
sudo xcodebuild -runFirstLaunch?
sudo xcodebuild -license
4.检测换件然后新建项目查看效果
5.Android配置请参考上一章Mac Air 配置Android开发环境_非生物语言学家的博客-CSDN博客
|