發表日期:2018-11 文章編輯:小燈 瀏覽次數:1845
下載Flutter SDK
https://flutter.io/docs/development/tools/sdk/archive?tab=macos#macos
安裝Flutter
第一步:得到flutter路徑
將下載后的文件放入應用程序中
第二步:配置.bash_profile
打開.bash_profile , 終端執行
open .bash_profile
加入以下配置(前2個是鏡像):
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=/Applications/flutter/bin:$PATH
注意:
此鏡像為臨時鏡像,并不能保證一直可用,讀者可以參考詳情請參考 Using Flutter in China 以獲得有關鏡像服務器的最新動態。
export PATH=你的Flutter路徑/bin:$PATH
保存并關閉.bash_profile后,終端執行:
source ~/.bash_profile
驗證是否安裝成功 ,終端輸入:
flutter -h
出現如下圖:表示正常
第三步:安裝Flutter的依賴項
檢測Flutter的依賴項 ,終端執行
flutter doctor
結果圖如下:按照截圖中由上至下的一個一個跟著提示安裝吧
安裝flutter doctor結果進行安裝開始(執行語句都是截圖中有的),結果如圖:允許協議,終端執行(在Mac存在AndroidStudio的情況下)
flutter doctor --android-licenses
執行結果:會各種確認,直接輸入y即可,一直到結束
安裝成功后終端再次輸入:flutter doctor,結果如圖:需要使用Brew,沒有brew那就裝一個吧
安裝Brew,終端執行:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
按照提示一步一步安裝就成了安裝成功后,按照flutter doctor的結果,在終端中執行:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
一直等直至都安裝完成,網絡環境比較好,1小時左右就可以了
安裝成功后再次執行flutter doctor,結果如圖:沒有安裝Xcode則安裝Xcode,可以通過AppStore安裝,安裝成功后終端執行:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
會要求輸入電腦密碼,輸入密碼即可
安裝成功后再次執行flutter doctor,結果如圖:提示安裝ios -deploy ,終端執行
brew install ios-deploy
安裝成功后再次執行flutter doctor,結果如圖:提示安裝CocoaPods 終端執行:
brew install cocoapods pod setup
安裝成功后再次執行flutter doctor,結果如圖:剩下的就是安裝AndroidStudio 插件
安裝完成了
注意:
參考地址:
https://juejin.im/post/5be3d54cf265da611d6624d3
https://flutterchina.club/setup-macos/Flutter中文網
日期:2018-10 瀏覽次數:7543
日期:2018-12 瀏覽次數:4626
日期:2018-07 瀏覽次數:5138
日期:2018-12 瀏覽次數:4417
日期:2018-09 瀏覽次數:5780
日期:2018-12 瀏覽次數:10197
日期:2018-11 瀏覽次數:5110
日期:2018-07 瀏覽次數:4861
日期:2018-05 瀏覽次數:5118
日期:2018-12 瀏覽次數:4590
日期:2018-10 瀏覽次數:5394
日期:2018-12 瀏覽次數:6464
日期:2018-11 瀏覽次數:4719
日期:2018-08 瀏覽次數:4871
日期:2018-11 瀏覽次數:12964
日期:2018-09 瀏覽次數:5880
日期:2018-12 瀏覽次數:5098
日期:2018-10 瀏覽次數:4444
日期:2018-11 瀏覽次數:4796
日期:2018-12 瀏覽次數:6325
日期:2018-06 瀏覽次數:4267
日期:2018-08 瀏覽次數:5713
日期:2018-10 瀏覽次數:4702
日期:2018-12 瀏覽次數:4819
日期:2018-07 瀏覽次數:4632
日期:2018-12 瀏覽次數:4803
日期:2018-06 瀏覽次數:4637
日期:2018-11 瀏覽次數:4622
日期:2018-12 瀏覽次數:4555
日期:2018-12 瀏覽次數:5533
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.