Getting started with Expo apps

You can generate React Native projects with the React Native CLI or with the Expo CLI. Expo is a toolchain that allows you to quickly get a React Native app up and running without having to use native code in Xcode or Android Studio.

In this guide we discuss how to set up, test, code sign and deploy your React Native project built with the Expo CLI.

Adding an Expo app to Bitrise

First, let’s see how to add a React Native Expo app to bitrise.io.

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:

  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.

  9. At Project build configuration, the React Native project type gets automatically selected. If the scanner fails and the project type is not selected automatically, you can configure your project manually. Bitrise also detects the Module and the Variant based on your project.

  10. Finish the configuration:

    • To generate an iOS app from your React Native project, enter your iOS Development team ID at the Specify iOS Development team field.

    • In Select ipa export method, select the export method of your .ipa file: ad-hoc, app-store, development or enterprise method.

    • In Specify Expo username, enter your username and hit Next.

    • In Specify Expo password, enter your password and hit Next.

  11. At Webhook setup, register a webhook so that Bitrise can automatically start a build every time you push code into your repository.

You have successfully set up your React Native project on bitrise.io! Your first build gets kicked off automatically using the primary workflow. You can check the generated reports of the first build on the APPS & ARTIFACTS tab on 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

Ejecting your Expo app

React Native apps built with Expo do not come with native modules. Since our build Steps are platform-specific, Bitrise has to eject your app, add and configure the necessary native templates. Then our native dependency installer Steps take care of installing any missing native dependencies so that your project is ready for building and shipping.

When adding a new Expo app, the Bitrise project scanner automatically inserts the Expo Eject Step right after the Run npm command or Run yarn command Steps in your deploy workflow.

If you do not wish to use the Expo Eject Step, you can eject your project locally and commit the native iOS/Android projects as an alternative to using the Expo Eject Step in the Workflow.

Getting started with Expo apps

If you use the Expo Eject Step, let’s see which fields you have to fill out:

  • Working directory input field: Provide the path of your project directory.

  • Expo CLI version: Provide the Expo CLI version you used for your project.

  • Username for Expo and Password for your Expo account inputs: If you add the password and username of your Expo account, the Step will execute the expo login command before it would do the expo eject. You can prevent issues by first logging into your Expo account before ejecting.

  • Run expo publish after eject? input: If you wish to run expo publish, you have to set this input to yes. Please note that to run expo publish, you first have to be logged into your Expo account which the Step can do for you if you populate the Username for Expo and the Password for Expo account inputs as well.

The Expo Eject Step can be followed by any platform-specific Step, for example, build, sign, or test. For example, you could use the Xcode Archive & Export for iOS Step for iOS.

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

Code signing an Expo app

All Android and iOS apps must be digitally signed before you can publish them to an online store. For apps built with Expo, the process is somewhat different than for vanilla React Native apps.

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.

  9. If the code signing files are manually generated on the Apple Developer Portal, you have to specify to use manual code signing settings since the ejected React Native project has Xcode managed code signing turned on. Click the xcodebuild configuration input group and add CODE_SIGN_STYLE="Manual" to the Additional options for xcodebuild call input field.

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

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.

Deploying your Expo 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).