React Native 入门级命令行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/danfengw/article/details/80669370

刚开始着手rn的项目,有些命令行还不熟悉,就自己记录一下,有些可能还是有帮助的。

1、创建项目

react-native init 项目名

2、运行项目

react-native run-android   //android 环境下
react-native run-ios        //ios环境下

3、安装依赖,需要执行以下两行

npm install 
react-native link

4、有时候我们使用真机在安装应用的时候存在安装不上去的时候

adb devices  (你会看到设备列表,其中包含设备号)
react-native run-android --deviceId 设备号

猜你喜欢

转载自blog.csdn.net/danfengw/article/details/80669370
今日推荐