Tools/Environment
Windows 10
command line tool (eg Powershell or windows command line)
Chocolatey (steps to setup via PowerShell)
The JDK (version 8)
Android Studio
An Intel machine with Virtualization technology enabled for HAXM (optional, only needed if you want to use
an emulator)
1) Setup your machine for react native development
Start the command line as an administrator run the following commands:
Code: Select all
choco install nodejs.install
choco install python2
Code: Select all
npm install -g react-native-cli
C:\Users\admin\AppData\Roaming\npm
2) Set your Environment Variables
Open the Environment Variables window by navigating to:
Code: Select all
[Right click] "Start" menu -> System -> Advanced System Settings -> Environment Variables
If you haven't added an ANDROID_HOME environment variable you will have to do that here too. While still in the "Environment Variables" window, add a new System Variable with the name "ANDROID_HOME" and value as the path to your android sdk.
Then restart the command line as an admin so you can run react-native commands in it
3) Create your project
In command line, navigate to the folder you want to place your project and run the
following command:
Code: Select all
react-native init ProjectName
Start an emulator from android studio Navigate to the root directory of your project in
command line and run it:
Code: Select all
cd ProjectName
Code: Select all
react-native run-android
To fix this you will have to open the sdk manager in Android Studio and download the build tools from there.
Congrats!
To refresh the ui you can press the r key twice while in the emulator and running the app. To see developer options you can press ctrl + m.