下载Flutter Sdk
Start building Flutter Android apps on macOS - Flutter 中文文档 - Flutter 中文开发者网站 - Flutter
下载后解压放到一个文件夹 /Users/zhiyu/Documents/gitflutter/flutter3.19.1/
环境变量中要用到
配置 Android 开发
下载 Android Studio 和应用工具 - Android 开发者 | Android Developers
cd ~
vim .bash_profile
export PATH=/Users/zhiyu/Documents/gitflutter/flutter3.19.1/bin:$PATH
#export PUB_HOSTED_URL=https://pub.flutter-io.cn
#export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export ANDROID_HOME=/Users/zhiyu/Documents/android_sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
source .bash_profile
flutter config --android-sdk /Users/zhiyu/Documents/android_sdk
flutter doctor --android-licenses # 接受Android sdk的许可证
flutter --version # 查看flutter版本信息
flutter doctor -v # 检查flutter设置和环境变量的详细信息
flutter devices # 查看连接的Android设备或模拟器
flutter emulators # 查看连接的Android模拟器
vscode 中安装 flutter
press cmd + Shift + P
-
Select the Flutter: New Project.
-
select Application.