ANDROID
You must generate a private key by running
$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
Then you have to set the generated file my-release-key.keystore
under android/app
in your project.
Edit the file ~/.gradle/gradle.properties
as following
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=[YOUR PASSWORD]
MYAPP_RELEASE_KEY_PASSWORD=[YOUR PASSWORD]
Now edit android/app/build.gradle
as following:
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
}
} }
And in your terminal run cd android && ./gradlew assembleRelease
Your APK will be generated inside this directory android/app/build/outputs/apk/
as app-release.apk
To install it in your device, run: react-native run-android --variant=release
More info in the official docs: https://facebook.github.io/react-native/docs/signed-apk-android.html
IOS
You must have an Apple Developer Account https://developer.apple.com/account/
Open Xcode and sign in with your developer account
Build your project
From toolabar Select Product > Archive
Click on Validate
Click on Export
Download IPA file
From toolabar Click on Xcode > Open Developer Tool > Application Loader
Click on Deliver App
Select the downloaded IPA file
Wait a few minutes and your app will be available on iTunes Connect itunesconnect.apple.com
From there you can use Test Flight to distribute your app to a test team.
Download Test Flight App in your device
After you set up a test team, all testers will be available to download the app through Test Flight
More info here: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html
Hope it helps