This article is to recording how to setup the develop android app environment on Linux.

[Environment]

  • Ubuntu 14.04

[Step]

      1. Installing node.js

     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

     8.Generate your first app

  • react-native init myfirst_react_native_app
  • cd myfirst_react_native_app
  • react-native run-android

[Result]

擷取.PNG

[Reference]

http://jamestw.logdown.com/posts/301099-react-early-native-experiences

http://bbs.reactnative.cn/topic/130/%E6%96%B0%E6%89%8B%E6%8F%90%E9%97%AE%E5%89%8D%E5%85%88%E6%9D%A5%E8%BF%99%E9%87%8C%E7%9C%8B%E7%9C%8B-react-native%E7%9A%84%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

http://www.2daygeek.com/install-upgrade-oracle-virtualbox-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/

http://itsonlycode.blogspot.tw/2015/05/install-multiple-versions-of-gcc-at.html

創作者介紹
創作者 I'm not 梵谷 的頭像
ps030010

I'm not 梵谷

ps030010 發表在 痞客邦 留言(0) 人氣( 33 )