macos系统:macOS Sequoia 15.6
Flutter 版本:3.32.0
一、环境准备
1. 安装 Homebrew(包管理器)
# 使用国内镜像安装
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2. 安装必要工具
brew install git curl unzip
# 设置 Git 代理(可选)
git config --global http.https://github.com.proxy http://127.0.0.1:7890
二、Flutter 安装与配置
1. 下载 Flutter SDK
# 使用清华镜像源
git clone https://mirrors.tuna.tsinghua.edu.cn/git/flutter-sdk.git flutter
2. 配置环境变量
在 ~/.zshrc
中添加:
# Flutter 配置
export FLUTTER_HOME="$HOME/flutter"
export PATH="$FLUTTER_HOME/bin:$PATH"
# 国内镜像设置(重要!)
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
使配置生效:
© 版权声明
文章版权归作者所有,未经允许请勿转载。如内容涉嫌侵权,请在本页底部进入<联系我们>进行举报投诉!
THE END
暂无评论内容