Skip to main content

React Native Environment Setups

There is a different alternative for React Native environment setup (installation), depends upon the operating system you use.

The instructions are quite different for each development and target operating system.
In this tutorial, we will use Windows as a development operating system and Android as a target operating system.

Developing app using React Native framework requires Node, React Native command line interface, Python2, JDK, and Android Studio.
Here, we are using a favorite package manager Chocolatey for Windows. Using this, we can install a recent version of Python, and Java SE Development Kit (JDK).


Steps to Setup React Native Environment

1. Visit Chocolatey, and click "Install Chocolatey Now" it open another URL.


React Native Environment Setup

2. Install chocolatey setup, copy the code provided in Install with cmd.exe section.
  1. @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"  
React Native Environment Setup

3. Open your Command Prompt in Administrative mode (right-click Command Prompt and select "Run as Administrator"), paste this code and click enter. It will install Chocolatey.

React Native Environment Setup


4. In the Administrative mode of command prompt, paste the code and run it (install Node.js, Python, and JDK).

If you have already installed Node.js, make sure it has version above 8 and if you have already installed JDK, make it version 8 or newer version.

  1. choco install -y nodejs.install python2 jdk8  
React Native Environment Setup

5. Node comes with npm (Node Package Manager), which lets you install the React Native. Run the given code:

  1. npm install -g react-native-cli  

React Native Environment Setup

Setup Android Studio

1. Visit Android website and download Android Studio.

React Native Environment Setup

2. Run the downloaded android studio set (.exe) file and follow the instruction.


React Native Environment Setup

3. Choose the feature you want to install.

React Native Environment Setup

4. Select the installation location.

React Native Environment Setup

5. Let the installation proceed and click Next.

React Native Environment Setup

6. Click Finish to complete the installation.

React Native Environment Setup

After successful installation, the Android Studio home screen will appear.

React Native Environment Setup

Setup Java JDK and Android SDK path

1. Visit How to set path in Java to set JDK path.

2. Set Android SDK path as My Computer > Properties > Advance system settings > Environment Variables > in System variables section. Click "New..." add Android home and Android SDK as bellow screen.

React Native Environment Setup

3. Install the required components, go to Tools Android > SDK Manager > SDK platforms and select the required components and install.

React Native Environment Setup

4. Let the installation proceed and after successfully installation, click Finish.

React Native Environment Setup

5. Create Android Emulator, a virtual Android Device, go to Tools > Android > AVD Manager > Create Virtual Device... SDK platforms and select the device type.

React Native Environment Setup

6. Select API level of Android Emulator.

React Native Environment Setup

7. Provide device name and set properties by clicking Show Advance Settings.

React Native Environment Setup

8. Launch the Emulator.

React Native Environment Setup

Comments

Popular Posts

Reloading UITableView while Animating Scroll in iOS 11

Reloading UITableView while Animating Scroll Calling  reloadData  on  UITableView  may not be the most efficient way to update your cells, but sometimes it’s easier to ensure the data you are storing is in sync with what your  UITableView  is showing. In iOS 10  reloadData  could be called at any time and it would not affect the scrolling UI of  UITableView . However, in iOS 11 calling  reloadData  while your  UITableView  is animating scrolling causes the  UITableView  to stop its scroll animation and not complete. We noticed this is only true for scroll animations triggered via one of the  UITableView  methods (such as  scrollToRow(at:at:animated:) ) and not for scroll animations caused by user interaction. This can be an issue when server responses trigger a  reloadData  call since they can happen at any moment, possibly when scroll animation is occurring. Example of s...

What are the Alternatives of device UDID in iOS? - iOS7 / iOS 6 / iOS 5 – Get Device Unique Identifier UDID

Get Device Unique Identifier UDID Following code will help you to get the unique-device-identifier known as UDID. No matter what iOS user is using, you can get the UDID of the current iOS device by following code. - ( NSString *)UDID { NSString *uuidString = nil ; // get os version NSUInteger currentOSVersion = [[[[[UIDevice currentDevice ] systemVersion ] componentsSeparatedByString: @" . " ] objectAtIndex: 0 ] integerValue ]; if (currentOSVersion <= 5 ) { if ([[ NSUserDefaults standardUserDefaults ] valueForKey: @" udid " ]) { uuidString = [[ NSUserDefaults standardDefaults ] valueForKey: @" udid " ]; } else { CFUUIDRef uuidRef = CFUUIDCreate ( kCFAllocatorDefault ); uuidString = ( NSString *) CFBridgingRelease ( CFUUIDCreateString ( NULL ,uuidRef)); CFRelease (uuidRef); [[ NSUserDefaults standardUserDefaults ] setObject: uuidString ForKey: @" udid " ]; [[ NSUserDefaults standardUserDefaults ] synchro...

Xcode & Instruments: Measuring Launch time, CPU Usage, Memory Leaks, Energy Impact and Frame Rate

When you’re developing applications for modern mobile devices, it’s vital that you consider the performance footprint that it has on older devices and in less than ideal network conditions. Fortunately Apple provides several powerful tools that enable Engineers to measure, investigate and understand the different performance characteristics of an application running on an iOS device. Recently I spent some time with these tools working to better understand the performance characteristics of an eCommerce application and finding ways that we can optimise the experience for our users. We realised that applications that are increasingly performance intensive, consume excessive amounts of memory, drain battery life and feel uncomfortably slow are less likely to retain users. With the release of iOS 12.0 it’s easier than ever for users to find applications that are consuming the most of their device’s finite amount of resources. Users can now make informed decisions abou...