以前看了 Google 发布的 Flutter ,一直没有机会尝试,最近须要作一个 App,因此让我有机会尝试一下。
React-Native 我用的比较熟,若是选择用 RN ,个人工做很快就能完成,可是我仍是决定选择 Flutter。android
在专栏中,我会记录从零开始,开发出一个完整 App 的一些过程和笔记。
学习文档我会参考 Flutter 官方文档ios
若是中途弃坑,各位勿怪~git
好了,转入正题,这篇记录一下在 Mac OS 上安装 Flutter 的一些过程github
安装很是简单,就是把代码 clone 下来,加入环境变量便可segmentfault
git clone -b beta https://github.com/flutter/flutter.git export PATH=`pwd`/flutter/bin:$PATH
因为 flutter 有些命令须要联网,因此为了速度咱们须要加一个镜像ide
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
在安装完成以后,咱们运行 doctor
来检查一下学习
flutter doctor
运行以后,咱们电脑输入内容以下this
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale zh-Hans-CN) [!] Android toolchain - develop for Android devices (Android SDK 27.0.3) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 9.4.1) ✗ 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 ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side. Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS. For more info, see https://flutter.io/platform-plugins To install: brew install cocoapods pod setup [✓] Android Studio (version 3.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [!] Connected devices ! No devices available ! Doctor found issues in 3 categories.
[!]
这个符号的,都是须要咱们去解决的,解决方法也特别简单,按照提示运行命令便可code
好比:orm
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
咱们按照提示运行 flutter doctor --android-licenses
便可
好了,安装仍是比较简单的,固然你的电脑环境可能比较曲折😭
关于 Android SDK 和 Android Studio 等配置,可参考我发布的另外一篇文章 https://segmentfault.com/a/11...
固然你们也能够加群一块儿学习~ (826912082)
1.官方文档
2.中文文档