React-Native常用命令

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

2019-04-06

下面是常用的RN命令。

1、初始化RN项目,并指定RN版本

react-native init [项目名称] --version RN版本

2、安装项目依赖

npm install

yarn install

扫描二维码关注公众号,回复: 5843785 查看本文章

3、强制重新安装项目依赖

yarn install --force

4、启动JS Server

yarn start

5、安装第三方依赖库

yarn add [第三库名称] [@版本]

6、运行RN项目

(1)react-native run-android

(2)react-native run-ios

7、打包发布android端的APP

在android目录下执行:gradlew assembleRelease

更多的RN命令请参考以下网站:

https://www.kancloud.cn/shellway/yarn-notes/262504

https://blog.csdn.net/haidaochen/article/details/8546796?utm_source=blogxgwz0

猜你喜欢

转载自blog.csdn.net/qq_33721382/article/details/89054876