Flutter环境安装
1.下载 Flutter SDK
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos
https://github.com/flutter/flutter/releases
2.设置环境变量
echo "export PATH=$PATH:/Users/mac/Documents/flutter/bin">>~/.profile
source ~/.profile
下面两句【RN已经设置过了 可以不用设置
echo "export ANDROID_HOME=/Library/Android/sdk">>/.profile
echo "export PATH=ANDROID_HOME/platform-tools:$PATH">>~/.profile
3.运行
flutter doctor
image.png
按提示安装即可
image.png
其他备份
If you need to have libxml2 first in your PATH run:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile
For compilers to find libxml2 you may need to set:
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
For pkg-config to find libxml2 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig”
4.打开ios模拟器
open -a Simulator
5.安装其他命令
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup
6.用android stuodio创建一个demo运行效果如下
image.png
如果您发现本文对你有所帮助,如果您认为其他人也可能受益,请把它分享出去。