react-native-cli 安装

react-native-cli 安装

1.按照依赖

https://reactnative.cn/docs/getting-started.html

2.查看设备是否连接

adb devices

3.运行

react-native init program-name #初始化项目

npm start(react-native start) #在项目目录下启动 js service

react-native run-android #已连接真机或开启模拟器前提下,启动项目

react-native run-ios #已连接真机或开启模拟器前提下(仅支持mac系统),启动项目