首页 > 代码库 > 在windows下搭建React Native Android开发环境

在windows下搭建React Native Android开发环境

1.登录 React Native 中文网
http://reactnative.cn/docs/0.45/getting-started.html

2.登录 Chocolatey 下载包管理工具
https://chocolatey.org/

3.打开 cmd 复制粘贴 Cmd.exe 中的命令代码
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1‘))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1‘))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

4.安装nodejs
choco install nodejs.install

5.安装python2
choco install python2

6.安装脚手架
npm install -g react-native-cli

7.创建项目
react-native init newPro

8.dirr 查看项目目录

9.安装jdk

10.安装android studio

11.启动模拟器

12.运行react native
react-native run-android

在windows下搭建React Native Android开发环境