Skip to content

Instantly share code, notes, and snippets.

@goldalworming
Forked from kosiara/setup_howto.txt
Created March 31, 2016 09:48
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 goldalworming/ff734ed4fa0ae61de4c853e02cebf9a1 to your computer and use it in GitHub Desktop.
Save goldalworming/ff734ed4fa0ae61de4c853e02cebf9a1 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