React Native iOS 环境搭建

1612 查看

1. 安装Homebrew

ruby -e $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

2. 安装nvm和nodes

nvm ->  curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash

手动将

export NVM_DIR="/Users/magicdawn/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

添加至~/.bash_profile ,  ~/.zshrc

注: 重启终端生效

3. 安装watchman

brew install watchman

4. 安装flow

brew install flow

完成上述步骤之后可以创建第一个React Native的iOS程序了.

-> npm install -g react-native-cli

-> react-native init HelloWorld

时间略长, 视网络速度而定......

打开 -> 工程/ios/HelloWorld.xcodeproj