1.安装XCode
https://apps.apple.com/cn/app/xcode/id497799835?mt=12
2.安装Android Studio
https://developer.android.google.cn/studio
3.安装brew
参考地址:https://www.jianshu.com/p/22122a1d4474
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
(按提示操作…)
brew -v
(Homebrew 4.4.4)
4.安装ruby
brew install rubyvi ~/.zshrc/**
#ruby
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"
export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"
**/source ~/.zshrcruby -v
(ruby 3.0.7)
5.安装cocoapods
安装最新版
brew install cocoapods
pod --version
(1.16.2)
指定版本安装
gem -v
(3.5.9)
gem sources
gem sources -a http://mirrors.aliyun.com/rubygems/
gem search cocoapods
sudo gem install -n /usr/local/bin cocoapods -v 1.11.3
pod --version
(1.11.3)
使用
pod repo
pod repo update
pod install
6.安装java
brew install --cask zulu@17
javac -version
7.安装node
brew install watchman
brew install node@18vi ~/.zshrc/**
export PATH="/opt/homebrew/opt/node@18/bin:$PATH"export LDFLAGS="-L/opt/homebrew/opt/node@18/lib"
export CPPFLAGS="-I/opt/homebrew/opt/node@18/include"
**/source ~/.zshrcnode --version
(v18.20.5)
8.安装flutter
brew tap leoafarias/fvm
brew install fvm
fvm —version
fvm install 2.8.1
fvm list
9.配置环境变量
vi ~/.zshrc/**
# flutter sdk
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=${PATH}:/Users/lax/fvm/default/bin# android sdk
export ANDROID_Home=/Users/lax/Library/Android/sdk
export PATH=${PATH}:ANDROID_Home/tools
export PATH=${PATH}:ANDROID_Home/platform-tools# java sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin# apksigner
export AAPT_HOME=$ANDROID_Home/build-tools/34.0.0
export PATH=$PATH:$AAPT_HOME# ruby
export PATH="/opt/homebrew/opt/ruby@3.0/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/ruby@3.0/lib"
export CPPFLAGS="-I/opt/homebrew/opt/ruby@3.0/include"# node
export PATH="/opt/homebrew/opt/node@18/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/node@18/lib"
export CPPFLAGS="-I/opt/homebrew/opt/node@18/include"
**/source .zshrc