指令 :flutter doctor 提示未安裝的按照提示安裝,如果沒有brew先安裝brew.
Doctor summary(to see all details,run flutter doctor -v):
[?]Flutter(Channel stable,v1.5.4-hotfix.2,on Mac OS X 10.14.5 18F132,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.dev/setup/#android-setup for detailed
? ? ? instructions).
? ? ? If the 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.2.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:
? ? ? ? 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)
[!]Connected device
? ? ! No devices available
更新環(huán)境變量的時候?
在修改完.bash_profile之后要讓.bash_profile生效的命令是:source .bash_profile;
不然會出現(xiàn):flutter: command not found
.bash_profile修改內(nèi)容為:
exportPUB_HOSTED_URL=https://pub.flutter-io.cn //國內(nèi)用戶需要設置exportFLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //國內(nèi)用戶需要設置exportPATH=PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH
注意路徑也要正確,PATH_TO_FLUTTER_GIT_DIRECTORY要替換成你自己解壓以后的flutter文件目錄所在的路徑,例如:export PATH=/Users/lixiwei/Desktop/flutter/flutter/bin:$PATH
-----------------------------------------------------------
新問題
bogon:flutter lixiwei$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, 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.dev/setup/#android-setup for detailed
? ? ? instructions).
? ? ? If the 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 installation is incomplete; a full installation is necessary for iOS
? ? ? development.
? ? ? Download at: https://developer.apple.com/xcode/download/
? ? ? Or install Xcode via the App Store.
? ? ? Once installed, run:
? ? ? ? sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
[!] Android Studio (not installed)
[?] Connected device (1 available)
我的xcode是app store直接安裝的,但是不知道為啥會提示這個,我確認不需要再去下載或者app store重裝,所以直接執(zhí)行sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer ,問題解決