Giter Club home page Giter Club logo

reactnative-android-production's Introduction

The instructions are the collective efforts from a few places online. Nothing here is my original. But I want to put them together in one place to save people from spending the same time.

First off, bundle.

  1. Go to the project directory cd
  2. Start the react-native packager if not started
  3. Download the bundle to the asset folder:
$ curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"

(Thanks : facebook/react-native#2743 (comment))

Note: make sure there is assets folder under android/app/src/main beforehand, and check if there is any error in the packager terminal window after curl.

Secondly, compile release version.

  1. cd to {YOUR_PROJECT}/android
  2. Build release version
$ ./gradlew assembleRelease

Thirdly, sign the apk.

  1. To generate keystore
$ keytool -genkey -v -keystore my-keystore.keystore -alias name_alias -keyalg RSA -validity 10000
  1. To sign an apk
$ jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk>  alias_name
  1. To zip align an apk
$ zipalign -f -v 4 <your.apk >  <your_aligned.apk>

(Thanks : http://stackoverflow.com/questions/26828372/how-to-sign-a-modded-an-apk-on-a-mac-with-apktool)

Lastly, install apk to device.

  1. Connect your phone to computer
  2. Install apk
$ adb install {PATH_TO_APK}

Visit http://facebook.github.io/react-native/docs/signed-apk-android.html for more details on generating signed APK

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.