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