Mac iOS、Android、Flutter、React Native开发环境配置

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 ruby

vi ~/.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 ~/.zshrc

ruby -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@18

vi ~/.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 ~/.zshrc

node --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
相关推荐
梦魇梦狸º7 小时前
mac 配置 python 环境变量
chrome·python·macos
丁总学Java12 小时前
macOS如何进入 Application Support 目录(cd: string not in pwd: Application)
macos
qdprobot12 小时前
Mixly米思齐1.0 2.0 3.0 软件windows版本MAC苹果电脑系统安装使用常见问题与解决
windows·macos
麦克Mapp12 小时前
不用安装双系统,如何在mac上玩windows游戏呢?
macos
符小易12 小时前
Mac苹果电脑 怎么用word文档和Excel表格?
macos·word·excel
梦魇梦狸º16 小时前
node安装与管理
macos·node.js
缘友一世1 天前
macOS查看当前项目的 tree 结构
macos
梦魇梦狸º1 天前
mac 安装 python2
python·macos
篮l球场2 天前
mac m1下载maven安装并配置环境变量
macos
YAIMZA2 天前
mac配置 iTerm2 使用lrzsz与服务器传输文件
服务器·macos·lrzsz