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

  

相关文章:

  • 2021-05-10
  • 2021-06-13
  • 2021-04-07
  • 2021-07-02
  • 2022-02-02
  • 2021-10-17
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
相关资源
相似解决方案