The following steps should be followed for new projects. Once completed for your project, you won't need these steps again.
General
- Ensure you have admin access to the destination Google Play and Apple/iTunesConnect Developer accounts
- Ensure you've named your app correctly and set a unique bundle identifier:
- Use react-native-rename
- eg.
react-native-rename "Travel App" -b com.junedomingo.travelapp
- eg.
- Open the project in Xcode and double check that the Bundle ID has been updated (if not, correct it)
- Use react-native-rename
- In both Google Play and iTunes Connect:
- Setup a new app
- Use the manual method below to build and deploy the app for the first time
- iOS Note: when you deploy the iOS app for the first time, you'll select 'Automatic Key Management'. Xcode will generate a private distribution key. Ensure you save this (eg. to a password safe) so that others can distribute the app too
Android
- Generate/configure Android key:
( cd android/app && keytool -genkeypair -v -keystore android-release-key.keystore -alias jims-app-release-key -keyalg RSA -keysize 2048 -validity 10000 )
(note: changejims-app-release-key
to your own alias)- Save the key to a secure password safe (don't commit it to the repo)
- Setup the Gradle variables, using the alias and password/s (that you set in the previous command) in:
android/gradle.properties
- Add the release signing config to your app's Gradle config in:
android/app/build.gradle
Fastlane
- Using the account owner's login (i.e. we want to create the API credentials from the owner's account) - follow the steps here to generate API credentials for Google Play. Download and place the json file here:
android/app/google-play-android-developer.json
. Save the key to a secure password safe (don't commit it to the repo) - Update the
package_name
anditc_team_id
(App Store Connect Team ID) infaslane/Appfile
to match the bundle of your app - Update the following in
fastlane/Fastfile
:app_identifier: com.app.bundle
- where com.app.bundle is your bundle idname.xcodeproj
- to the name of your Xcode project filescheme: 'name'
- where name is your scheme (eg. AppName)
- Run
fastlane supply init
(which will download the meta data of the uploaded app, from the stores)
The following steps are provided for developers who have the project setup on their machine, but have not yet deployed the app. Follow these once, and you won't need these steps again.
- Android (Google Play):
- Add the Android keys (found in the password safe) to your local project:
android/app/android-release-key.keystore
android/app/google-play-android-developer.json
- Android/Google dependencies
- Add the Android keys (found in the password safe) to your local project:
- iOS (Apple iTunes Connect):
- In Xcode, login to the appropriate account to give you access to deploy
- Install the appropriate distribution private key (found in your password safe)
- Download the file and double click it to add to Keychain
- Fastlane (for automated deployments on both platforms):
- Install Fastlane -
brew cask install fastlane
- Install Xcode command line tools -
xcode-select --install
- Install Fastlane -
- Update the app version -
bash fastlane/update-app-version.sh
- Merge
develop
branch intomaster
branch with a merge commit - Git Tag the master merge commit. The tag name should be the new version number
- Bundle and deploy by the following:
Fastlane automatically builds and deploys the app to the app stores (TestFlight and Play Store Beta).
- Hint: Did you update the version number, merge to master and tag?
- iOS: Deploy to Apple TestFlight -
fastlane ios beta
- Android: Deploy to Google Play Beta -
fastlane android beta
2.2.1 iOS
*Note: it may be required to use the legacy build system (XCode -> File -> Project Settings -> Change the build system to 'Legacy Build System')
- Hint: Did you update the version number, merge to master and tag?
- Ensure you've changed the Xcode 'Build Config' to Release
- Select 'Generic iOS Device' from devices
- Product > Archive
- Open Organiser
- Find the archive and click 'Validate' to check that it's ok
- Click the big 'Upload to App Store...' when ready (untick BitCode checkbox)
2.2.2 Android
- Hint: Did you update the version number, merge to master and tag?
( cd android && ./gradlew app:bundleRelease )
- Upload the generated file (
/android/app/build/outputs/bundle/release/app.aab
) to Google Play