React Native – Setting up the environment

Integrated Development Environments

First things first. In order to get create React Native applications you are going to need the right IDEs.

Xcode for iOS

Android Studio for Android

React Native with IntelliJ IDEA

Configuring Android Emulator:

touch ~/.zshenv
open ~/.zshenv

Then in paste the following at the bottom of your newly opened file:

export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

(macOS) Type source ~/.zshenv to reload .zshenv and update any functions you add.

source ~/.zshenv

For a list of AVD names, enter the following command:

emulator -list-avds

Here’s the basic command-line syntax for starting a virtual device from a terminal prompt:

emulator @avd_name [ {-option [value]} … ]

# Example
emulator -avd Nexus_5X_API_23 -netdelay none -netspeed full

You can create an alias command to start emulator easier. In macOS, add the following lines at the bottom of .zshrc :

touch ~/.zshrc
open ~/.zshrc
alias run-android-emulator='emulator -avd Nexus_6_API_29 -netdelay none -netspeed full'

Reload and run:

source ~/.zshrc

To emulate the iOS platform, you need to install the ios-sim command-line tool globally. You can do it through the Node Package Manager (npm), see npm and Yarn, or by running the sudo npm install ios-sim -g command, depending on your operating system.

sudo npm install ios-sim -g

In the Arguments field, type the arguments to be passed to React Native, for example, specify the simulator type through the ‑‑simulator flag: ‑‑simulator="iPhone 4s".

https://www.jetbrains.com/help/idea/react-native.html#ws_react_native_run_and_debug

Share this
Send this to a friend