為您解碼網(wǎng)站建設(shè)的點(diǎn)點(diǎn)滴滴
發(fā)表日期:2018-10 文章編輯:小燈 瀏覽次數(shù):2420
在??Macintosh HD?
? ?用戶?
? ?(用戶名)
? ?.bash_profile
文件中添加如下代碼(如果看不到隱藏文件,使用command
+shift
+.
快捷鍵顯示,如果沒(méi)有該文件請(qǐng)手動(dòng)創(chuàng)建):
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
ps 終端如果已經(jīng)翻墻則不需要上面的文件,翻墻方法:
在~/.bash_profile
文件后面加上下面的代碼(port是翻墻軟件(如小火箭等)的代理端口號(hào)):export http_proxy="http://localhost:port" export https_proxy="http://localhost:port"
保存后到終端順序執(zhí)行如下代碼:
git clone -b master https://github.com/flutter/flutter.git./flutter/bin/flutter --version
安裝成功后的界面:
安裝成功后添加如下代碼到.bash_profile
文件中(注意替換成正確的路徑):
export PATH=/Users/(用戶名)/flutter/bin:$PATH
刷新終端:
source /Users/(用戶名)/.bash_profile
在終端中輸入如下代碼:
flutter upgrade
如果步驟1成功了 那么就會(huì)開(kāi)始自動(dòng)更新了
終端中輸入:
flutter doctor
會(huì)輸出對(duì)應(yīng)的依賴的安裝情況,例如:
按照提示安裝x
號(hào)對(duì)應(yīng)的依賴項(xiàng)即可。
安裝libimobiledevice碰到問(wèn)題可以看這里。
需要注意的是Android Studio需要3.0以上版本,可以直接到Android Studio中文社區(qū)下載,安裝完成后打開(kāi)Android Studio(彈窗點(diǎn)取消,然后根據(jù)提示下載SDK)。
安裝完成后需要配置一下Android 的SDK:
Mac下Android SDK配置環(huán)境變量的配置
1.啟動(dòng)Android Studio.
2.打開(kāi)插件首選項(xiàng) (Preferences
>Plugins
).
3.選擇 Browse repositories…
, 搜索 Flutter 插件并點(diǎn)擊 install.
4.重啟Android Studio后插件生效.
1.選擇 File>New Flutter Project
2.選擇 Flutter application 作為 project 類型, 然后點(diǎn)擊 Next
3.輸入項(xiàng)目名稱 (如 myapp), 然后點(diǎn)擊 Next
4.點(diǎn)擊 Finish
5.等待Android Studio安裝SDK并創(chuàng)建項(xiàng)目.
創(chuàng)建一個(gè)Android模擬器然后運(yùn)行剛才創(chuàng)建的項(xiàng)目。
Flutter中文網(wǎng) 文檔
日期:2018-10 瀏覽次數(shù):7551
日期:2018-12 瀏覽次數(shù):4636
日期:2018-07 瀏覽次數(shù):5146
日期:2018-12 瀏覽次數(shù):4425
日期:2018-09 瀏覽次數(shù):5788
日期:2018-12 瀏覽次數(shù):10206
日期:2018-11 瀏覽次數(shù):5118
日期:2018-07 瀏覽次數(shù):4866
日期:2018-05 瀏覽次數(shù):5123
日期:2018-12 瀏覽次數(shù):4595
日期:2018-10 瀏覽次數(shù):5402
日期:2018-12 瀏覽次數(shù):6470
日期:2018-11 瀏覽次數(shù):4724
日期:2018-08 瀏覽次數(shù):4876
日期:2018-11 瀏覽次數(shù):13026
日期:2018-09 瀏覽次數(shù):5890
日期:2018-12 瀏覽次數(shù):5106
日期:2018-10 瀏覽次數(shù):4452
日期:2018-11 瀏覽次數(shù):4804
日期:2018-12 瀏覽次數(shù):6329
日期:2018-06 瀏覽次數(shù):4272
日期:2018-08 瀏覽次數(shù):5718
日期:2018-10 瀏覽次數(shù):4709
日期:2018-12 瀏覽次數(shù):4828
日期:2018-07 瀏覽次數(shù):4638
日期:2018-12 瀏覽次數(shù):4812
日期:2018-06 瀏覽次數(shù):4643
日期:2018-11 瀏覽次數(shù):4628
日期:2018-12 瀏覽次數(shù):4563
日期:2018-12 瀏覽次數(shù):5540
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.