Flutter中文网中的文档介绍的很详细,值得好好看看
本文借鉴Flutter中文网编辑
获取Flutter SDK
1.在国内访问FLutter时有可能会受到限制,可用直接使用临时镜像:
终端命令:
vim ~/.bash_profile
中添加:
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
2.直接去官网下载最新可用的安装包,转到下载页
或者去Flutter GitHub项目下载安装包,转到下载页
3.解压安装包到你想安装的目录,如:
cd ~/development unzip ~/Downloads/flutter_macos_v0.5.1-beta.zip
4.解压好的Flutter相关工具路径添加到:
vim ~/.bash_profile export PATH=Flutter解压路径目录/flutter/bin:$PATH
5.终端运行Flutter doctor(有提示依赖项)
source ~/.bash_profile flutter doctor
下载
1.安装完Xcode正常运行open -a Simulator
启动模拟器
记得添加Android Studio路径到bash_profile中然后执行步骤5
export ANDROID_HOME="Android Studio解压目录/Android/sdk" export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools
暂且如此,后续继续补充!
网友评论