react-native(ios)简单配置环境(mac)

1、首先全局安装react-native-cli

npm install -g react-native-cli

2、安装xcode(appStore)

3、打开xcode,检查一下是否装有某个版本的Command Line Tools,没有就安装

4、创建新的项目

react-native init AwesomeProject

5、编译并运行

cd AwesomeProject
react-native run-ios

 

注意:

1、gem相关的内容,切换gem的源

gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
gem sources -l

2、设置程序指向

sudo xcode-select --switch /Applications/Xcode.app

全新的步骤,避免踩坑

1、确保node版本在12.*以上

2、确保安装了xcode

3、确保设置了xcode的程序指向

4、安装(一步到位)

npx react-native init AwesomeProject

  

posted @ 2019-10-23 15:28  kimingw  阅读(248)  评论(0编辑  收藏  举报