Build React Native Android development environment under Windows

Source: Internet
Author: User
Tags install node

Widows version: Win7 64-bit Professional Edition

1. Install the JDK. (I use the JDK7)

Note Select x86 or x64 version, add to system PATH environment variable

2. Get the Android SDK ready

This is not much to say, it is recommended to use Android Studio, the simulator recommended to use Genymotion, than the own AVD is much faster.

3. Installing the C + + environment

You can install Visual Studio 2013 or 2015 directly, or you can choose a separate SDK to compile the C + + module for node. js.

4. Install node. js

Download node. js from official website, I downloaded the latest v5.3.0 stable version

https://nodejs.org/en/.

5. Installing the React-native command-line tool

NPM install-g REACT-NATIVE-CLI

6. Create your own project

Enter the working directory and run:

React-native Init REACTNATIVE_P1

PS:REACTNATIVE_P1 is your own project name.

7. Running Packager

Old version:

If you have Cygwin installed, you can enter the project directory in the Cygwin environment and run

NPM start

If there is no Cygwin or not in the Cygwin environment, you can enter the project directory and run

Node Node_modules\react-native\packager\packager.js

If you are downloading the latest version, install Cygwin, then switch to Node_modules\react-native\packager and then run:

./packager.sh--nonpersistent

Note Be sure to add--nonpersistent parameter, otherwise it will fail because of loading watchman

You can use the browser to access the http://localhost:8081/index.android.bundle?platform=android to see if you can see the packaged script, can be normal to show success.

8. Running the simulator

about how to install and use genymotion later, we can directly search the relevant information can be, you can also directly use the AVD.

9. Running in the Android emulator

Open a new CMD window, go to the project directory to run (the seventh step of the packager operation is a prerequisite, and can not be turned off)

React-native run-android

10. Installing the Debugging Tools

Visit Http://localhost:8081/debugger-ui, install Chrome or Firefox debugging tools, how to use is still groping ...

Build React Native Android development environment under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.