Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phabreeze/9e749f5bd07599c2c15e2e5e7ec5d0c3 to your computer and use it in GitHub Desktop.
Save phabreeze/9e749f5bd07599c2c15e2e5e7ec5d0c3 to your computer and use it in GitHub Desktop.
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
$ cd android
# build debug apk
$ ./gradlew assembleDebug
# build release/unsigned apk
$ ./gradlew assembleRelease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment