博客
关于我
安装react-native-cli工具(三)
阅读量:742 次
发布时间:2019-03-22

本文共 863 字,大约阅读时间需要 2 分钟。

设置淘宝镜像 (这一步可以省略)

npm config set registry --global

npm config set disturl --global1

然后安装完 yarn 后同理也要设置镜像源 (这一步可以省略)

yarn config set registry --global
yarn config set disturl --global

全局安装nrm npm install -g nrm

执行命令nrm ls查看可选的源。
切换到淘宝
nrm use taobao

使用nrm工具切换淘宝源

nrm use taobao

如果之后需要切换回官方源可使用

npx nrm use npm

安装react-native-cli工具

npm i react-native-cli -g //全局安装 第一次这样做哈!以后就不需要了

react-native init rnapp (rnapp 是项目名)
等它安装
cd rnapp
ps===》cd 之前人家提示你必须要有一个模拟器
你执行adb devices 如果有模拟器端口 说明是有模拟器

react-native run-android 启动项目

最后会出现 BUILD SUCCESSFUL
你就可以关闭这个窗口了
等几分钟就会在你的模拟手机上出现RN的页面上的视图

如何热跟新

在cmd 中adb shell input keyevent 82
在 模拟器弹出的界面中,选择
Live哪一个 到那时安卓模拟器却没有LIVE这个选项


C:\Users\user\AppData\Local\Android\sdk1\platforms是安卓的SDK的目录哈。

你可以去看那些安装成功了的。
C:\Users\user\AppData\Local\Android\sdk1\platforms
第一次这个目录下有android-24


项目结构介绍

index.js是入口文件哈
app.js是一个顶级组件
初始化的页面就是在app.js中哈

转载地址:http://vrwwk.baihongyu.com/

你可能感兴趣的文章
Nginx+Keepalived实现简单版高可用主备切换
查看>>
nginx+mysql+redis+mongdb+rabbitmq 自动化部署脚本
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
Nginx+Tomcat实现动静分离
查看>>
nginx+Tomcat性能监控
查看>>
nginx+uwsgi+django
查看>>
nginx+vsftp搭建图片服务器
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
nginx-vts + prometheus 监控nginx
查看>>
Nginx/Apache反向代理
查看>>
Nginx: 413 – Request Entity Too Large Error and Solution
查看>>
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
Nginx、HAProxy、LVS
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>
nginx中配置root和alias的区别
查看>>