npm install react-native-cli -g

react-native init yourproject

npm install

react-native run-ios

问题1:卡在命令行里打开不了模拟器;解决方法:打开vpn,有些依赖需要翻墙

react-native 环境安装常见问题-LMLPHP

react-native run-android

问题2:

Failed to install the following Android SDK packages as some licences have not been accepted

解决方法:Change directory to /Users/windseek/Library/andriod/sdk/tools/bin And over here run ./sdkmanager --licenses Accept the licenses and you'll be good to go

问题3:Make sure you have an Android emulator running or a device connected and have
运行一个安卓模拟器
在android目录下新建local.properties

sdk.dir = /Users/windseek/Library/Android/sdk
设置sdk目录
05-28 22:25