react-native环境搭建(windows)

  1. 官方下载安装node(包含了npm)

  2. android skd环境变量配置
    新建 ANDROID_HOME 环境变量,变量值是SDK解压的路径(D:\Android)
    PATH添加:%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools\23.0.1

  3. Setup
    npm install -g react-native-cli
    react-native init AwesomeProject

  4. Starting the app on Android
    react-native run-android
    adb reverse tcp:8081 tcp:8081
    react-native start // 启动http服务

遇到问题:
1.   com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unable to upload some APK
    解决方法: 把项目中的~/android/build.gradle中的gradle版本改为1.2.3

你可能感兴趣的:(react-native环境搭建(windows))