Setting up windows for using react native

Setting up windows for using react native

Hey there! here we will be seeing how we can set up react native CLI for running it on our devices.

-> REQUIRED DEPENDENCIES

  1. NODEJS

  2. OPENJDK (JAVA)

  3. ANDROID STUDIO

One thing to keep in mind is that we won't be using the android studio to run our app rather we'll be using our android phone.

Now, nodeJs and OpenJDK can be installed from the web itself but a more convenient way is to install chocolatey, which is a Package Manager for Windows and this will allow us to download node and OpenJDK in our PowerShell itself.

Chocolatey can be downloaded from the following link👇

Chocolatey

Once installed, run the command prompt as administrator and run the following command.

choco install -y nodejs-lts microsoft-openjdk11

This will install nodejs and java in your computer. now we are only left with android studio, which can be downloaded and installed from this site easily(no customization needed just click on next next)

Android Studio

The final step is setting up environment variables. Let's take care of that

Search for "edit environment variable" in windows search and open, hit enter and it will open this window

here in user variable, click on edit and then add a new path i.e

The sdk is installed in the following location

%LOCALAPPDATA%\Android\Sdk

open PowerShell and run the following command and check if the ANDROID_HOME has been added.

Get-ChildItem -Path Env:\

Now in the same window, click on path and edit and then new. add the default path and click on ok.

%LOCALAPPDATA%\Android\Sdk\platform-tools

Hurrayy!! we are all set to run and test react native apps now.