發表日期:2018-12 文章編輯:小燈 瀏覽次數:2297
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn git clone -b beta https://github.com/flutter/flutter.git export PATH="$PWD/flutter/bin:$PATH" cd ./flutter
執行
flutter doctor
檢測flutter環境
[?] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14 18A391, locale zh-Hans-CN) [?] Android toolchain - develop for Android devices ? Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.io/setup/#android-setup for detailed instructions). If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location. You may also want to add it to your PATH environment variable.[!] iOS toolchain - develop for iOS devices (Xcode 10.1) ? libimobiledevice and ideviceinstaller are not installed. To install with Brew, run: brew update brew install --HEAD usbmuxd brew link usbmuxd brew install --HEAD libimobiledevice brew install ideviceinstaller ? ios-deploy not installed. To install with Brew: brew install ios-deploy ? Brew can be used to install tools for iOS device development. Download brew at https://brew.sh/. [!] Android Studio (not installed) [!] VS Code (version 1.29.1) [?] Connected device (1 available)
以上結果代表flutter環境已安裝好,但是andriod跟ios的工具沒安裝好,根據提示安裝就可。如何沒有安裝homebrew,使用以下命令安裝即可
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
進入vs code執行Cmd+
Shift+
P選擇Flutter: new project,輸入項目名稱