参考文章:https://reactnative.cn/docs/getting-started.htmlhtml
环境搭建(略,见参考文章)node
建立并运行项目 react
react-native-cli init HelloWorld
react-native run-ios //失败
使用xcode打开项目,手动run报错。ios
0.45 及以上版本须要下载 boost 等几个第三方库。npm
查看当前项目的版本:react-native
cd HelloWorld react-native -v
结果是xcode
react-native-cli: 2.0.1 react-native: 0.58.6
下载boost第三方库,地址:https://pan.baidu.com/s/1kVDUAZ9spa
cd ~/.rncache #文件夹不存在则手动建立
cp ~/Downloads/boost_1_63_0.tar.gz ~/.rncache #从新编译 cd HelloWorld rm -fr ./node_modules npm install #运行 react-native run-ios