Table of Contents generated with DocToc
https://facebook.github.io/react-native/docs/android-setup.html
-
install git, npm, java
-
$ brew install android-sdk
-
$ vim ~/.bashrc
&&$ vim ~/.bash_profile
&& them all add the following:export ANDROID_HOME=/usr/local/opt/android-sdk
-
$ android
and config the Android SDK
$ git clone source
$ cd source_folder
$ git pull origin staging
$ npm install
$ npm install -g react-native-cli
$ brew install watchman
https://facebook.github.io/react-native/docs/signed-apk-android.html
$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
- config and get the file
my-release-key.keystore
, move it toandroid/app
directory in your project folder $ vim ~/.gradle/gradle.properties
- add the following (replace ***** with the correct keystore password, alias and key password)
MYAPP_RELEASE_STORE_FILE = my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS = my-key-alias
MYAPP_RELEASE_STORE_PASSWORD = *****
MYAPP_RELEASE_KEY_PASSWORD = *****
$ android avd
- create an android device && start it
$ react-native run-android
- tips: if you close the shell, to re-listening the change in your project, ues
$ npm start
||$ react-native start