Deploy React Native iOS App To TestFlight and distribute the app using Transporter

Saima Chaity
4 min readOct 8, 2021

This document describes all the steps needed to perform a TestFlight (iOS) build and distribute it using Transporter.

Setup Apple developer account, certificate, identifier and profile

  • Login to Apple developer account. A developer account is required to create App IDs, profiles and certificates for the app.
  • Select Certificates, Identifiers & Profiles and then navigate to Identifiers → App IDs and create an ID for the app. This ID will be used as Bundle Identifier in the project.
  • Two types of certificates are available in iOS for Development and Production and these certificates can be generated from Keychain access on Mac.
  • Request a CSR (Certificate Signing Request) from keychain access and download it. This CSR file will be used to create certificates on Apple developer account.
  • Use the CSR file to create certificates. I have used Apple Distribution type certificate in order to test build on registered devices.
  • Create a Provisioning profile using the certificate. (Apple distribution type certificate in my case).
  • If the app has push notification service, select the identifier and enable push notifications under capabilities. Once it is enabled, click on the edit button and create APN certificate using the CSR file. We need to create separate production and development certificates for push notification service.
  • For Production certificate, navigate to Certificates and select — Apple Push Notification service SSL(Sandbox & Production) and for Development certificate select — Apple Push Notification service SSL(Sandbox).
  • Download the certificate and provisioning profile and include these to the build. Double click on the certificate to save it to keychain account.

Prepare project for build

  • Open project and run command npm install. I have used npm package manager in the project.
  • Once it is successful, navigate to ios directory and run command pod install.
  • From the ios directory open the file which has extension .xcworkspace in Xcode.
  • Change scheme to build the app in debug mode or release mode. Navigate to Product → Scheme → Edit Scheme to specify the build configuration.
  • Select the project in Xcode and include the AppIcon for iPhone and iPad(if supported by the application).
  • To build the app, select Generic iOS device in the top navigation bar.
  • In Xcode, select target and navigate to the general tab.
  • Under general tab, update Identity, Deployment Info, App Icons and Launch images.
  • If the app has push notification services, then navigate to the Signing & Capabilities tab and in order to include push notification service click the +Capability button and add Push Notifications. Also, under Background Mode, mark Remote notification to ON.
  • Select proper team, bundle identifier, certificate and provisioning profile under the Signing & Capabilities tab.
  • Navigate to Build Setting Tab and verify Code Signing Identity to ensure that it points to the proper certificate. If the app has push notification services, verify the Code Signing Entitlements to ensure that it points to the file that has <Project Name>.entitlements extension.
  • In .entitlements file, add the following pieces of code for push notification service on production.
<key>aps-environment</key>
<string>production</string>
  • For production build, change app method to app-store in exportOptions.plist file and update the file with the teamID, bundle identifier, certificate and provisioning profile.
<key>method</key>
<string>app-store</string>

Build and distribute the app

  • Clean the build folder and run the build command to build the app. It is also possible to use the Archive option on Xcode (Product → Archive) to generate the IPA file.
  • If the build fails or doesn’t update the release.xcarchive, then remove the app folder from ios directory and build the app from Xcode (Product → build). Once the build is successful, run the build command to build the app or use the Archive option on Xcode.
  • After build is successful, distribute the IPA file using Transporter.
  • Transporter will show errors, if there are any errors. Fix those errors and rebuild the app. If error persists, remove the app folder from ios directory and build again.
  • Once the transporter delivers the app successfully, navigate to the Apple developer account and select TestFlights to view the build. It might take some time to show the build.
  • Download and install the app when it is available for testing.

--

--