flutter问题集
已经安装过了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中的内容复制一份到zshrc文件中,如果bash_profile文件没有,就自己写一份关于flutter的环境配置
5 格式:PATH=${PATH}:/Users/xxx/xx/flutter/bin:$PATH
7 source ~/.zshrc重新保存一下配置
8 flutter doctor运行一下看是否配置好。
2、Flutter学习之常用命令
参考:
Flutter学习之常用命令
Flutter常用命令行
检查环境
flutte doctor
查看命令的帮助信息:flutter help
检查版本flutter --version
升级版本flutter upgrade
检查当前环境flutter channel
获取模拟器列表(iOS、Android模拟器):flutter emulators
获取所有真机设备列表包括iOS模拟器:flutter devices
运行指定模拟器或者真机:flutter run -d <deviceId>
创建flutter项目flutter create flutter_demo
获取flutter packagesflutter packages get
更新flutter项目所有依赖包:flutter packages upgrade
运行:flutter run
热加载:r
打包ipa:flutter build ios