mac 的环境变量
打开
open -e .bash_profile
应用
source .bash_profile
1、先安装Java SDK
https://blog.csdn.net/vvv_110/article/details/72897142
2、安装Android studio
https://zhuanlan.zhihu.com/p/103295634
3、Xcode
https://www.jianshu.com/p/8a8f513b4407
https://developer.apple.com/download/more/
4、flutter
查看有没有什么问题或者未安装的插件
flutter doctor
如果报错:
1、Android license status unknown.: https://www.jianshu.com/p/8f4c57045166
2、Xcode - develop for iOS and macOS
就是要安装正确的Xcode版本,并且在应用程序里面
3、✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
https://blog.csdn.net/survivorsfyh/article/details/93407580
然后重启
4、VS Code (version 1.48.2)
✗ Flutter extension not installed;
在vscode上安装flutter插件即可
最终效果
最终的环境变量:
环境变量文字版:
export PATH=/usr/local/bin:$PATH
export PATH=$PATH:/usr/local/mysql/bin
export PATH=$PATH:/usr/local/mysql/support-files
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPATH
export PATH=/Users/mac/Documents/flutter/flutter/bin:$PATH
export ANDROID_HOME=/Users/mac/Documents/Android/SDK
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
参考:
https://flutterchina.club/setup-macos/
https://book.flutterchina.club/chapter1/install_flutter.html