React Native入门学习笔记一(环境搭建windows+android)

win+android开发环境搭建


装备工作:

需要安装jdk、android sdk、nodejs、git

安装

参考网站:http://facebook.github.io/react-native/docs/getting-started.html
以管理员身份运行,要确保能访问https://chocolatey.org网站。
http://www.jianshu.com/p/1a3452aaa578

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

choco install python2

choco install nodejs.install

npm install -g react-native-cli

choco install jdk8

下载安装android studio

下载运行demo

git clone https://github.com/ruanyf/react-demos.git

安装react-native源码

执行命令检出项目:
git clone https://github.com/facebook/react-native.git

在浏览器运行示例

这里写图片描述

这是网友整理的一份学习指南链接:
http://www.tuicool.com/articles/zaInUbA

初始化项目

react-native init testProject

这里经常遇到的问题是初始化速度很慢。
整理几个网上的处理方式:
- 下载配置好的项目
http://bbs.reactnative.cn/topic/11/react-native中文网官方发布完整新项目包-无需init

使用AndroidStudio打开项目

运行命令:

npm start
或
react-native start

nodejs会打开一个默认端口:8081,如果要更改这个端口,可以使用命令:

react-native start --port 9988

这里写图片描述

真机或模拟器调试

下载安装Genymotion,安装模拟器并启动。安装方法:
http://blog.csdn.net/xundh/article/details/47775519

打开另一个cmd窗口定位在同样目录,输入命令:

react-native run-android
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程圈子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值