Getting started with React Native apps

You can easily set up and configure your React Native project on Bitrise. A React Native repo can consist of an Android and an iOS project so configurations should be done as you would normally do with Android and iOS apps. When running a React Native project on Bitrise, you will see that first an Android, then an iOS build gets built.

Do you have a Bitrise account?

Make sure you have signed up to bitrise.io and can access your Bitrise account. There are multiple ways of registering an account:

Adding a React Native app to Bitrise

This procedure will guide you through the process of adding your app to Bitrise, connecting your repository, setting up your repository access, selecting a branch and validating your project. Below we highlight some React Native-specific configuration as well.

  1. Go to your Bitrise Dashboard.

  2. Click the + sign on the top menu bar and select , which takes you to the Create New App page.

  3. Choose the account you wish to add the app to.

  4. Set the privacy of the app to either Private or Public and click Next.

  5. Select the Git hosting service that hosts your repository, then find and select your own repository that hosts the project.

  6. When prompted to set up repository access, click No, auto-add SSH key.

  7. Type the name of the branch that includes your project’s configuration - main, for example, - then click Next.

  8. Wait while Bitrise is validating your project. If your configuration files are available on the selected branch, the scanner will detect your app as a React Native app.

    If your project consists of only one module, that module will be automatically selected for Module. If your project contains more than one module, you can pick a module, but we recommend the main one!

  9. In the Variant field, select a variant that suits your project. Pick Select All Variants to build all variants. Pick debug or release if you wish to generate an APK or an IPA file.

  10. In the Project (or Workspace) field, select your Xcode project or Xcode Workspace path.

  11. In the Select Scheme name, pick a scheme name. The scanner validation will fail if you do not have a SHARED scheme in your project. You can still point Bitrise manually to your Xcode scheme but if it’s shared, we automatically detect it for you.

  12. In Select ipa export method, select the export method of your .ipa file: ad-hoc, app-store, development or enterprise method. Don't worry, you can change this later.

You have successfully set up your React Native project on bitrise.io! Your first build gets kicked off automatically. You can check the generated artifacts of the first build on the APPS & ARTIFACTS tab of your Build’s page.

Installing dependencies for React Native apps

If the Bitrise project scanner has successfully scanned your React Native project, Run npm command or Run yarn command Steps will be included in your default Workflows. These Steps can install the missing Javascript dependencies for your app.

For native Android dependencies, you can use the Install missing Android SDK components Step.

For native iOS dependencies, you can use, among others, the Brew install Step or the Run CocoaPods install Step.

Expo apps

If you have an Expo app, you must eject the app before installing native dependencies. Ejecting your Expo app

To install Javascript dependencies with npm:

Using Yarn instead of npm

In this guide, we're using npm to install Javascript dependencies. However, you can use the Run yarn command Step: it can install missing JS dependencies without any additional configuration required.

  1. Open your app on Bitrise.

  2. Go to the Workflow tab.

  3. Select a Workflow from the WORKFLOW dropdown menu.

    Installing any additional tools
  4. Make sure your Workflow includes the Run npm command Step.

  5. In the npm command with arguments to run input field, type install.

    Getting started with React Native apps

Code signing for React Native apps

A React Native app can consists of two projects, an Android and an iOS - both have different signing procedures. If you click the Code Signing tab of your project’s Workflow Editor, all iOS and Android code signing fields are displayed in one page for you. Follow our platform-specific instructions to code sign your app for both iOS and Android.

Signing your Android project

All Android apps must be digitally signed with a certificate before they can be installed on Android devices. On Bitrise, you can use our dedicated Step for this purpose but first you'll need a keystore file.

  1. Generate a keystore file.

  2. Open your app on Bitrise.

  3. Go to the Workflow tab.

  4. Go to the Code Signing tab.

  5. Drag-and-drop your keystore file to the ANDROID KEYSTORE FILE field.

  6. Fill out the Keystore password, Keystore alias, and Private key password fields and click Save metadata.

    Getting started with Android apps
  7. Select a Workflow from the WORKFLOW dropdown menu.

  8. Add the Android Sign Step to your Workflow.

Signing your iOS project

Code signing your iOS project depends on what you wish to do with the exported IPA file. You can sign your file so that you can test it on registered devices or you can use different code signing settings to build an app that is ready for distribution. You can also do both in the same Workflow!

iOS code signing

This guide is only an introduction to iOS code signing. For more details, check out our dedicated guides: iOS code signing

  1. Build your Xcode project locally, on your own device.

  2. Collect your code signing files with our codesigndoc tool.

    You can use the tool to immediately upload the collected files to Bitrise. Otherwise, upload them manually to the Code signing tab in the Workflow Editor.

    Note

    The type of code signing files required depends on your requirements. We strongly recommend uploading at least:

    • A Developer and an App Store type code signing certificate.

    • A Development and a Distribution type provisioning profile.

  3. Open your app on Bitrise.

  4. Go to the Workflow tab.

  5. Select a Workflow from the WORKFLOW dropdown menu.

    Installing any additional tools
  6. Make sure that you have the Certificate and profile installer Step in your workflow.

  7. Find the Distribution method input of the Xcode Archive & Export for iOS Step.

    Getting started with React Native apps
  8. Select a value for this input: this will determine the type of the IPA file you build.

    • development allows you to install development apps on registered test devices. Mostly used for debugging and functional testing during development. Requires a Developer type certificate and a Development type Provisioning Profile.

    • ad hoc allows you to install an app on a limited number of registered devices. Requires a Distribution type certificate and an Ad Hoc type provisioning profile.

    • app store allows you to publish an app to the App Store. Requires a Distribution type certificate and an App Store type provisioning profile.

    • enterprise is used for in-house app distribution for enterprises. Only available for enterprises registered in the Apple Developer Enterprise Program.

That's it. When you run a build, it will generate a signed IPA for you.

Testing your React Native app

You can use React Native’s built in testing method, called jest to perform unit tests.

  1. Open your app on Bitrise.

  2. Go to the Workflow tab.

  3. Select a Workflow from the WORKFLOW dropdown menu.

    Installing any additional tools
  4. Add the run npm command Step to your Workflow.

  5. In the npm command with arguments to run input field, type test.

    Getting started with React Native apps

Deploying a React Native app

You can deploy your React Native app to:

  • bitrise.io: This allows you download the generated binary, and to share it with others via the public install page.

  • Online stores: we have integrations for multiple different online stores. In these guides, we'll show you how to publish to Google Play and to Apple's App Store.

Deploying a cross-platform app to bitrise.io

The Deploy to bitrise.io Step uploads all the artifacts related to your build into the APPS & ARTIFACTS tab on your Build’s page.

You can share the generated app file (AAB for Android or an IPA file for iOS) with your team members using the public install page. The public install page is a URL you can share with others who can install the generated app binary on their device. You can also notify user groups or individual users that your AAB/APK or IPA file has been built.

Publishing to expo.io

The Deploy to Bitrise.io Step does not use Expo commands and doesn’t publish to expo.io. This Step publishes artifacts to Bitrise and is not specific to a particular platform.

If you need to publish to expo.io, set the Run expo publish after eject? input of the Eject Expo Step to yes. Be aware that in that case you have to provide your username and password for your Expo account to publish to expo.io.

  1. Open your app on Bitrise.

  2. Go to the Workflow tab.

  3. Select a Workflow from the WORKFLOW dropdown menu.

    Installing any additional tools
  4. Make sure you have the Deploy to bitrise.io Step in your Workflow.

  5. In the Notify: User Roles, add the role so that only those get notified who have been granted with this role. Or fill out the Notify: Emails field with email addresses of the users you want to notify.

    Make sure you set those email addresses as Secrets! These details can be also modified under Notifications if you click the eye icon next to your generated binary in the APPS & ARTIFACTS tab.

  6. If you want the Step to generate a public install page for you, set the Enable public page for the App? input to true.

Deploying your iOS project to the App Store

  1. Configure iOS code signing for your iOS project.

  2. Add the Deploy to iTunes Connect - Application Loader Step to your Workflow, after the Xcode Archive & Export for iOS Step but preferably before the Deploy to Bitrise.io Step.

  3. Provide your Apple credentials in the Deploy to iTunes Connect - Application Loader Step.

    The Step will need your:

    • Apple ID.

    • Password or, if you use two-factor authentication on App Store Connect, your application password.

    Don’t worry, the password will not be visible in the logs or exposed.

  4. Start a build.

Deploying your Android project to Google Play

You can use the Deploy to Google Play Step in your Workflow to upload your digitally signed AAB/APK to the Google Play Store.

  1. Configure code signing for your app.

  2. Configure Google Play access.

    You only need to do this for your very first Google Play deployment of the app.

  3. Make sure you have the Deploy to Google Play Step after the Android Sign Step in your Workflow.

  4. Fill out the required input fields as follows:

    • Service Account JSON key file path: This field can accept a remote URL so you have to provide the Env Var which contains your uploaded service account JSON key. For example: $BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL.

    • Package name: The package name of your Android app.

    • Track: The track where you want to deploy your APK (for example, alpha/beta/rollout/production or any custom track you set).