Skip to content

Instantly share code, notes, and snippets.

@mehmetkose
Forked from kosiara/setup_howto.txt
Created December 18, 2015 09:33
Show Gist options
  • Save mehmetkose/4fd84e1db2c659843581 to your computer and use it in GitHub Desktop.
Save mehmetkose/4fd84e1db2c659843581 to your computer and use it in GitHub Desktop.
Setup Facebook React-native sample (empty) project on Ubuntu
# author:
# @Bartosz Kosarzycki
#
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
==================== if something goes wrong: ==============================
check node.js version
> node --version
v0.10.25
if it's below 0.12 upgrade your node.js:
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install -y nodejs
> node --version
v0.12.7
=================================================
Check your adb version:
adb version
Android Debug Bridge version 1.0.31
if it's below 1.0.32 upgrade your adb tools
> adb version
Android Debug Bridge version 1.0.32
Revision 09a0d98bebce-android
====== "Unable to download JS bundle" ===========================================
#
# In order to run the Facebook react app you need to start the JS server on the PC and forward port 8081 to the phone
#
> sudo react-native start
(or
> sudo react-native start > /dev/null 2>&1 &
to start in the background)
> adb reverse tcp:8081 tcp:8081
(Note that this option is available on devices running android 5.0+ (API 21).!!!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment