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
相关推荐
弓弧名家_玄真君12 分钟前
mac 安装graalvm
macos
看海的四叔11 小时前
【系统】Mac crontab 无法退出编辑模式问题
运维·macos·定时任务·crontab
liupenglove11 小时前
Elasticsearch8.17.0在mac上的安装
macos
satadriver15 小时前
macos控制台安装
macos
时空无限15 小时前
mac iterm2 使用 lrzsz
macos
十八胡笳1 天前
mac-m2安装mysql遇到的问题
mysql·macos
程序员 超超1 天前
Stable Diffusion 安装教程(附安装包) 【SD三种安装方式,Win+Mac一篇文章讲明白】
人工智能·macos·ai作画·stable diffusion·midjourney
Roseann YAN1 天前
macos big sur 软件icons图标大全(新增至2719枚大苏尔风格图标)
macos
益达是我2 天前
【Java】mac安装Java17(JDK17)
java·开发语言·macos