必须安装的依赖有:Node、React Native 命令行工具、Python2 以及 JDK 和 Android Studio。
一、配置python2
二、react-native-cli安装
# 使用nrm工具切换淘宝源npx nrm use taobao
Yarn、React Native 的命令行工具
npm install -g yarn react-native-cli
三、安装 Android SDK
Tip:SDK下载后得安装

四、连接夜神模拟器运行
打开夜神模拟器,连接
adb connect 127.0.0.1:62001

//查看连接设备adb devices//如果有其他设备adb reveser tcp:8081 tcp:8081
五、输出hello world
//app.jsimport React, { Component } from 'react';import { Text, View } from 'react-native';export default class HelloWorldApp extends Component { //HelloWorldApp可以自定义名字render() {return (<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}><Text>Hello, world!</Text></View>);}}
六、启动
路径别他妈有中文!!!
npx react-native run-android
