- .从gitthub拉取代码:
git clone -b beta https://github.com/flutter/flutter.git
- 配置环境变量:
在当期用户目录下创建.bash_profile文件,如果该文件已经存在, 则直接打开。将以下代码复制到.bash_profile中,
export PATH_TO_FLUTTER_GIT_DIRECTORY=/Users/你的用户
名/flutterexport PATH=${PATH}:$
{PATH_TO_FLUTTER_GIT_DIRECTORY}/bin
完成之后点击保存,在命令行中执行source .bash_profile,
然后输入flutter 进行测试。没有出现commond not found
即是配置成功。
- 执行命令flutter doctor ,命令的作用是检测还需要安装的依赖。
[✓]Flutter(Channel beta,v0.1.5,on Mac OS X 10.13.3 17D102,locale zh-Hans-CN)
[✓]Android toolchain - develop for Android devices(Android SDK 27.0.3)
[!]iOS toolchain - develop for iOS devices(Xcode 9.2) //ios环境
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
[✓]Android Studio(version 3.0) //表示android 环境已经搭建好
[!]IntelliJ IDEA Ultimate Edition(version 2017.3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓]VS Code(version 1.21.0) //编辑器插件检测
[!]Connected devices 连接的设备
! No devices available
- 所有的依赖安装完成以后 会有如下的提示
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2017.3.1)
[✓] VS Code (version 1.21.0)
[✓] Connected devices (1 available)
- 这个时候的 你的环境配置就算是完成了。(因为本人之前是做ReactNtive开发的,所以已经安装好了一些其他的环境,例如AndroidStudio,Xcode等)