發表日期:2018-08 文章編輯:小燈 瀏覽次數:2431
bash, mkdir, rm, git, curl, unzip, which
git clone -b beta https://github.com/flutter/flutter.git export PUB_HOSTED_URL=https://pub.flutter-io.cn //國內用戶需要設置 export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //國內用戶需要設置 export PATH=`pwd`/flutter/bin:$PATH
1.確定您Flutter SDK的目錄,您將在步驟3中用到;
2.在終端打開(或創建) $HOME/.bash_profile. 文件路徑和文件名可能在您的機器上不同;
3.添加以下行并更改[PATH_TO_FLUTTER_GIT_DIRECTORY]為克隆Flutter的git repo的路徑;
//Android sdk 環境變量配置(沒配置的需要配置) export ANDROID_HOME="/Users/geek/Library/Android/sdk"export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools//Flutter sdk 環境變量配置 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=/Users/geek/flutter/bin:$PATH //注意說明:geek為我本機的用戶名,配置時請替換為你自己本機的用戶名;注意確認自己Flutter SDK本機路徑;
注意: 由于一些flutter命令需要聯網獲取數據,如果您是在國內訪問,由于眾所周知的原因,直接訪問很可能不會成功。 上面的PUB_HOSTED_URL和FLUTTER_STORAGE_BASE_URL是google為國內開發者搭建的臨時鏡像。
//1.刷新當前終端窗口 source $HOME/.bash_profile //2.查看Flutter配置是否已經在PATH環境變量 echo $PATH
sunnydeMacBook-Pro:cache geek$ flutter doctor ╔════════════════════════════════════════════════════════════════════════════╗ ║ WARNING: your installation of Flutter is 74 days old.║ ║║ ║ To update to the latest version, run "flutter upgrade".║ ╚════════════════════════════════════════════════════════════════════════════╝ Doctor summary (to see all details, run flutter doctor -v): [?] Flutter (Channel beta, v0.5.1, on Mac OS X 10.11.6 15G20015, locale zh-Hans) [!] Android toolchain - develop for Android devices (Android SDK 28.0.2) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 8.2.1) ? Flutter requires a minimum Xcode version of 9.0.0. Download the latest version or update via the Mac App Store. ? Brew not installed; use this to install tools for iOS device development. Download brew at https://brew.sh/. [?] Android Studio (version 3.1) [?] IntelliJ IDEA Ultimate Edition (version 2018.2) [!] Connected devices! Doctor found issues in 3 categories.
sunnydeMacBook-Pro:cache geek$ flutter upgrade Upgrading Flutter from /Users/geek/flutter... From https://github.com/flutter/flutter01d6444..ef71d9dmaster -> origin/master Already up-to-date.Upgrading engine... Already up-to-date.Flutter 0.5.1 ? channel beta ? https://github.com/flutter/flutter.git Framework ? revision c7ea3ca377 (3 months ago) ? 2018-05-29 21:07:33 +0200 Engine ? revision 1ed25ca7b7 Tools ? Dart 2.0.0-dev.58.0.flutter-f981f09760Running flutter doctor... Doctor summary (to see all details, run flutter doctor -v): [?] Flutter (Channel beta, v0.5.1, on Mac OS X 10.11.6 15G20015, locale zh-Hans) [!] Android toolchain - develop for Android devices (Android SDK 28.0.2) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 8.2.1) ? Flutter requires a minimum Xcode version of 9.0.0. Download the latest version or update via the Mac App Store. ? Brew not installed; use this to install tools for iOS device development. Download brew at https://brew.sh/. [?] Android Studio (version 3.1) [?] IntelliJ IDEA Ultimate Edition (version 2018.2) [!] Connected devices! Doctor found issues in 3 categories.
Waiting for another flutter command to release the startup lock
查了一下github的flutter issue 找到了解決方法,如下:
1、打開flutter的安裝目錄/bin/cache/ ;
2、刪除lockfile文件(rm -rf lockfle);
3、重啟AndroidStudio;
重啟Android Studio后插件生效.
具體如下圖所示:
日期:2018-10 瀏覽次數:7253
日期:2018-12 瀏覽次數:4328
日期:2018-07 瀏覽次數:4876
日期:2018-12 瀏覽次數:4174
日期:2018-09 瀏覽次數:5502
日期:2018-12 瀏覽次數:9922
日期:2018-11 瀏覽次數:4804
日期:2018-07 瀏覽次數:4578
日期:2018-05 瀏覽次數:4859
日期:2018-12 瀏覽次數:4324
日期:2018-10 瀏覽次數:5139
日期:2018-12 瀏覽次數:6212
日期:2018-11 瀏覽次數:4464
日期:2018-08 瀏覽次數:4592
日期:2018-11 瀏覽次數:12630
日期:2018-09 瀏覽次數:5579
日期:2018-12 瀏覽次數:4833
日期:2018-10 瀏覽次數:4188
日期:2018-11 瀏覽次數:4528
日期:2018-12 瀏覽次數:6063
日期:2018-06 瀏覽次數:4007
日期:2018-08 瀏覽次數:5436
日期:2018-10 瀏覽次數:4457
日期:2018-12 瀏覽次數:4525
日期:2018-07 瀏覽次數:4362
日期:2018-12 瀏覽次數:4500
日期:2018-06 瀏覽次數:4383
日期:2018-11 瀏覽次數:4375
日期:2018-12 瀏覽次數:4249
日期:2018-12 瀏覽次數:5283
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.