Skip to content

Instantly share code, notes, and snippets.

@SakhirAtwi
Created August 10, 2018 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SakhirAtwi/a4deb6aa5a19b9d9a5b1d1f66ec0e6d3 to your computer and use it in GitHub Desktop.
Save SakhirAtwi/a4deb6aa5a19b9d9a5b1d1f66ec0e6d3 to your computer and use it in GitHub Desktop.
Installing React-Native on Ubuntu

First, you'll need NodeJS and NPM:

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
nodejs -v
v8.4.0

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
https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip sdk-tools-linux-3859397.zip

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