已經(jīng)安裝過了flutter sdk
1眉踱、zsh: command not found: flutter
參考:zsh: command not found: flutter
1 打開open ~/.zshrc累魔,
2 如果沒有就新建vim ~/.zshrc
3 打開open ~/.bash_profile
4 把bash_profile中的內(nèi)容復(fù)制一份到zshrc文件中石咬,如果bash_profile文件沒有,就自己寫一份關(guān)于flutter的環(huán)境配置
5 格式:PATH=${PATH}:/Users/xxx/xx/flutter/bin:$PATH
7 source ~/.zshrc重新保存一下配置
8 flutter doctor運行一下看是否配置好豺型。
2奋蔚、Flutter學(xué)習(xí)之常用命令
參考:
Flutter學(xué)習(xí)之常用命令
Flutter常用命令行
檢查環(huán)境
flutte doctor
查看命令的幫助信息:flutter help
檢查版本flutter --version
升級版本flutter upgrade
檢查當(dāng)前環(huán)境flutter channel
獲取模擬器列表(iOS、Android模擬器):flutter emulators
獲取所有真機(jī)設(shè)備列表包括iOS模擬器:flutter devices
運行指定模擬器或者真機(jī):flutter run -d <deviceId>
創(chuàng)建flutter項目flutter create flutter_demo
獲取flutter packagesflutter packages get
更新flutter項目所有依賴包:flutter packages upgrade
運行:flutter run
熱加載:r
打包ipa:flutter build ios