Flutter Mac iOS 環境配置

官方文檔:flutter.io/docs/get-st…

1.須要的命令行工具

bash curl git 2.x mkdir rm unzip whichios

2.SDK下載地址

flutter_macos_v1.0.0-stable.zip storage.googleapis.com/flutter_inf…git

3.解壓Flutter SDK

cd ~/Flutter/SDK $ unzip ~/Downloads/flutter_macos_v1.0.0-stable.zip Flutter SDK 包含了Dart SDK,不須要單獨安裝Dart SDKmacos

4.設置Flutter SDK環境變量

4.1 打開或者建立HOME/.bash_profile
    viHOME/.bash_profileapi

4.2 在最後加入下面的命令 export PATH=$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/binbash

例如:
export PATH=$PATH:/Users/junhuashao/Flutter/SDK/flutter/bin
複製代碼

4.3 完成後更新下環境變量 source $HOME/.bash_profilecurl

4.4 添加完成後,調用命令 「echo $PATH」,查看環境變量是否添加成功ide

5.運行Flutter

5.1 運行命令「flutter doctor -v」檢測SDK安裝是否成功。若是存在錯誤,根據提示來修復錯誤
複製代碼

好比個人提示就是 ✗ Verify that all connected devices have been paired with this computer in Xcode. If all devices have been paired, libimobiledevice and ideviceinstaller may require updating. To update with Brew, run: brew update brew uninstall --ignore-dependencies libimobiledevice brew uninstall --ignore-dependencies usbmuxd brew install --HEAD usbmuxd brew unlink usbmuxd brew link usbmuxd brew install --HEAD libimobiledevice brew install ideviceinstaller ✗ ios-deploy not installed. To install with Brew: brew install ios-deploy工具

出現這個提示,把手機鏈接上,或者模擬器開起來,再試一次。 Tips:快速打開模擬器的方法,在命令行執行命令「open -a Simulator」,在 Hardware > Device 中能夠切換設備ui

爲 Android Studio安裝Flutter和Dart插件

1.開啓Android Studio。 2.打開設置(Preferences > Plugins) 3.點擊Browse repositories,搜索Flutter plugin,點擊Install 4.當提示要安裝Dart插件的時候,點擊YES。 5.安裝完成後點擊Restart Android Studio,重啓下。this

相關文章
相關標籤/搜索