This article is to recording how to setup the develop android app environment on Linux.
[Environment]
- Ubuntu 14.04
[Step]
1. Installing node.js
- Donwload path as below:https://nodejs.org/en/download/stable/
- tar -zxvf node.tar.gz
- ./configure
- make
- sudo make install
2. Installing Android SDK Package
- Download path as below: https://developer.android.com/sdk/index.html#Other
- tar -zxvf android-sdk-linux.tgz
- cd android-sdk-linux
- vim ~/.brashrc
- Add below command line: export ANDROID_HOME=<android-sdk-linux>
- tools/android update sdk --no-ui
- tools/android update sdk -u -a(add this solution for cannot found android-23)
3. Installing Watchman
- git clone https://github.com/facebook/watchman.git
- cd watchman
- ./autogen.sh
- ./configure
- make
- sudo make install
4. Installing Flow
- sudo npm install -g flow-bin
5. Installing React-Native
- npm install -g react-native-cli
6. Installing VirtualBox
- sudo apt-get remove virtualbox-4*
- sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list"
- wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
- sudo apt-get install dkms
- sudo apt-get update
- sudo apt-get install virtualbox-5.0
- sudo apt-get install --only-upgrade virtualbox-5.0
- sudo apt-get install gcc-4.9 gcc-5 g++-4.9 g++-5(add this solution for include/linux/compiler-gcc.h:106:30: fatal error: linux/compiler-gcc5.h: No such file or directory)
- sudo /etc/init.d/vboxdrv setup
7. Installing Genymotion
- Download path as below: https://www.genymotion.com/download/, you need to register genymotion account for download.
- ./genymotion.bin
- cd genymotion
- ./genymotion
8.Generate your first app
- react-native init myfirst_react_native_app
- cd myfirst_react_native_app
- react-native run-android
[Result]

[Reference]
http://jamestw.logdown.com/posts/301099-react-early-native-experiences
http://itsonlycode.blogspot.tw/2015/05/install-multiple-versions-of-gcc-at.html
請先 登入 以發表留言。