Flutter環境搭建(Mac)

- .從gitthub拉取代碼:

git clone -b beta https://github.com/flutter/flutter.git

- 配置環境變量:

在當期用戶目錄下創建.bash_profile文件,如果該文件已經存在, 則直接打開。將以下代碼復制到.bash_profile中,

? ? export PATH_TO_FLUTTER_GIT_DIRECTORY=/Users/你的用戶

? ? 名/flutterexport PATH=${PATH}:$

? {PATH_TO_FLUTTER_GIT_DIRECTORY}/bin

完成之后點擊保存,在命令行中執行source? .bash_profile,

然后輸入flutter 進行測試。沒有出現commond not found

即是配置成功。

-? 執行命令flutter doctor ,命令的作用是檢測還需要安裝的依賴。

[?]Flutter(Channel beta,v0.1.5,on Mac OS X 10.13.3 17D102,locale zh-Hans-CN)

[?]Android toolchain - develop for Android devices(Android SDK 27.0.3)

[!]iOS toolchain - develop for iOS devices(Xcode 9.2)? //ios環境

? ? ? 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

[?]Android Studio(version 3.0) //表示android 環境已經搭建好

[!]IntelliJ IDEA Ultimate Edition(version 2017.3.1)

? ? ? Flutter plugin not installed; this adds Flutter specific functionality.

? ? ? Dart plugin not installed; this adds Dart specific functionality.

[?]VS Code(version 1.21.0)? //編輯器插件檢測

[!]Connected devices 連接的設備

? ? ! No devices available

- 所有的依賴安裝完成以后? 會有如下的提示

Doctor summary (to see all details, run flutter doctor -v):

[?] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale zh-Hans-CN)

[?] Android toolchain - develop for Android devices (Android SDK 27.0.3)

[?] iOS toolchain - develop for iOS devices (Xcode 9.2)

[?] Android Studio (version 3.0)

[?] IntelliJ IDEA Ultimate Edition (version 2017.3.1)

[?] VS Code (version 1.21.0)

[?] Connected devices (1 available)

- 這個時候的 你的環境配置就算是完成了。(因為本人之前是做ReactNtive開發的,所以已經安裝好了一些其他的環境,例如AndroidStudio,Xcode等)

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容