Instantly share code, notes, and snippets.

What would you like to do?
Installing React-Native on Ubuntu

First, you'll need NodeJS and NPM:

sudo apt install curl
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs
nodejs -v

Then you can install react-native using npm

sudo npm install -g react-native-cli

Now you need to install Java/ Android

sudo apt-get install default-jre
sudo apt-get install default-jdk

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
  • Install Android
  • Install Android SDK requirements
cd ~
mkdir android-sdk
cd android-sdk

We add the path of our Android SDK tools to .bashrc so that we have access to the Android tools.

cd ~
pico .bashrc

# Add these lines to the top of the file
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools

# CTRL+O (uppcase o) to save
# CTRL+X to exit

source ~/.bashrc

Now we have access to the android command

android update sdk --no-ui
# Answer 'y' to all prompts

sdkmanager "platforms;android-23" "build-tools;23.0.1" "add-ons;addon-google_apis-google-23"
  • TODO: Install GenyMotion
  • TODO: Get a project running

Create your first project!

mkdir projects
cd projects
react-native init my-first-project
cd my-first-project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment