1.从gitthub拉取代码:git clone -b beta https://github.com/flutter/flutter.git
2.配置环境变量:在当期用户目录下创建.bash_profile文件,如果该文件已经存在,则直接打开。将以下代码复制到.bash_profile中,
export PATH_TO_FLUTTER_GIT_DIRECTORY=/Users/你的用户名/flutter
export PATH=${PATH}:${PATH_TO_FLUTTER_GIT_DIRECTORY}/bin
完成之后点击保存,在命令行中执行source .bash_profile,然后输入flutter 进行测试。没有出现commond not found 即是配置成功。
3.执行命令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