1.下载FlutterSDK
https://flutter.io/setup-macos/
2.配置环境变量
3.编辑 .bash_profile文件
①.打开 .bash_profile文件: open -e .bash_profile
②.添加字段:
git clone -b beta https://github.com/flutter/flutter.git
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=pwd
/flutter/bin:$PATH
③.保存: source .bash_profile
(下载完后需要再打开一次.bash_profile,删除git clone -b beta https://github.com/flutter/flutter.git
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn,)
4.运行flutter doctor 查看是否需要安装其他依赖项
flutter doctor
例如: Android toolchain - develop for Android devices
• Android SDK at /Users/obiwan/Library/Android/sdk
✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
• Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
就是说明缺少AndroidSDK