react-native ios2020开发环境搭建

自学react-native,搭建ios环境踩了不少坑,仅供参考。。。

1.安装brew

/bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”

2.安装node

brew install node
npx nrm use taobao (可选切换淘宝源,快)

3.安装yarn (高级版npm)

npm install -g yarn

4.安装cocoapods (ios依赖库)

brew install cocoapods
切换源
pod repo remove trunk
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git

5.安装watchman(官网文档说要装,但是我装了就会报错,卸载了就可以跑了,迷~)

·brew install watchman

6.安装xCode

appstore有

7.安装react-native-cli 脚手架

npm install -g react-native-cli

8.创建helloworld工程

react-native init helloworld

9.启动

cd helloworld;npm run ios

10.起飞

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值