Last active
May 28, 2019 10:54
-
-
Save eftikharEmad/ed4f124ea00600cd5ee8533cf8133ae7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) locate your jdk bin folder: | |
`/usr/libexec/java_home` | |
2) navigate to your jdk bin folder | |
`cd /usr/libexec/java_home` | |
3) to generate a signing key | |
`sudo keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000` | |
-- will ask you to add password and information | |
4) copy my-release-key.keystore to ~/mobile/app/ | |
5) in main mobile app open android/gradle.properties to edit by adding those lines : | |
``` | |
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore | |
MYAPP_RELEASE_KEY_ALIAS=my-key-alias | |
MYAPP_RELEASE_STORE_PASSWORD=***** | |
MYAPP_RELEASE_KEY_PASSWORD=***** | |
``` | |
place values with real one used in step 3 | |
6) open android/app/build.gradle to update it as | |
``` | |
android { | |
... | |
defaultConfig { ... } | |
signingConfigs { | |
release { | |
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { | |
storeFile file(MYAPP_RELEASE_STORE_FILE) | |
storePassword MYAPP_RELEASE_STORE_PASSWORD | |
keyAlias MYAPP_RELEASE_KEY_ALIAS | |
keyPassword MYAPP_RELEASE_KEY_PASSWORD | |
} | |
} | |
} | |
buildTypes { | |
release { | |
... | |
signingConfig signingConfigs.release | |
} | |
} | |
} | |
``` | |
7) cd android | |
8) ./gradlew assembleRelease | |
====> make sure to uninstall your app from device you want to bild the app on it | |
9) Final run | |
`react-native run-android --variant=release` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment