- Create a bundle
$ react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios
- Comment this line in
AppDelegate.m
,
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
- Uncomment this one,
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
- Generate a private signing key using
keytool
.
$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
- Place the
my-release-key.keystore
file under the android/app
directory in your project folder.
- Edit the file android/app/build.gradle in your project folder and add the signing config.
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
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
}
}
}
...
- Simply run the following in a terminal,
$ cd android && ./gradlew assembleRelease