Flutter SDK下载
下载SDK:
https://flutter.dev/docs/development/tools/sdk/releases
配置环境变量
环境变量配置文件路径: ~/.bash_profile
1 | export FLUTTER_HOME=/YourPath/flutter |
然后通过命令: source ~/.bash_profile
重新加载即可。
对终端使用zsh的系统版本,环境变量路径为:~/.zshrc
可以通过命令echo $PATH
查看环境变量。
遇到的问题
问题描述:
Exception: Flutter failed to create a directory at “YourPath/flutter”. The flutter tool cannot access the file or directory.
解决: sudo chown -R $USER path