React Native

1、环境配置
详细步骤移步RN中文网:https://reactnative.cn/docs/0.51/getting-started.html
比较随意的话,就有可能出现和我一样的错误:
a. xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
b. node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
Qa:Xcode里的偏好设置

React Native_第1张图片
1.png

Qb:应该是项目的依赖包获取失败,但是我没找到原因,我安装了Watchman之后重新编译,才好的。虽然是推荐安装,但是就目前来看还真的是必须安装了。
React Native_第2张图片
屏幕快照 2018-07-26 下午10.06.18.png

c.RN运行指定设备
查看iOS设备:在终端中输入xcrun simctl list devices
react-native run-ios --simulator "iPhone 7 Plus”
d.code-push whoami 查看当前的账户

你可能感兴趣的:(React Native)