Android 安裝教學
我是使用ubuntu 去安裝的,應該是三平台中(window, mac, linux) 中最難去安裝的。能踩的坑都幫大家踩了,只是安裝也弄了3小時。
安裝React-native command line
-g = 全域
全域安裝到你的Linux 系統上,讓你可以隨處跑react-native 命令
npm install -g react-native-cli #安裝React native command line 在你的系統上
Watchman
更改code時不用re-compile。對於一些超大型應用compile 時間超過五分鐘,而你只是想要看一下DEBUG LOG,有時侯真的很無奈。有了這watchman 就不用再苦等了!
git clone https://github.com/facebook/watchman.git
cd watchman
git checkout v4.7.0 # the latest stable release
./autogen.sh
./configure
make
sudo make install
安裝JDK
請注意地方, 必需是java8 否則將會出現 Security key not found 以及 EC parameter error
http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
安裝 Genymotion 模擬器
它是一款比原生AVD 快很多的Android 模擬器, 有實機或打算用原生模擬器可以skip 這part
首先,下載一下Genymotion
連結 : https://www.genymotion.com/download/
打一下command 安裝一下
chmod +x genymotion-2.x.x_x64.bin #下載回來的bin檔, 沒有executable權限,先加一下給它
./genymotion-2.x.x_x64.bin #執行genymotion
看看是否在這個directory 安裝
安裝完成後,找一下icon 執行它
設定模擬器
如果平台是Ubuntu 請必需檢查版來一定是 16.04 LTS
選擇API 16 --22 以內的模擬器
按Next 成功安裝完成後, 首頁會發現已經增加了一個option, 再按start
完成後將會出現模擬器
參考:
https://facebook.github.io/react-native/docs/getting-started.html
http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
https://sysads.co.uk/2014/06/21/install-genymotion-in-ubuntu-14-04/