appkickstarter logoAppKickstarter

Distribution

You've done the hard work, now let's share your app for others to use.

Introduction

In the previous steps (Installation), you learned how to build a development client (a build of the native part of the app), and then start a development server (serves the JavaScript bundle part of the app). This works great for development, as it gives us hot module reloading (we see code changes instantly when we hit Save), but not for sharing the app with others. The development client requires connection to the development server, so if your device is not on the same network, or offline, it won't work. This is not ideal for your users.

Now, we'll learn how to go from development to a final, shiny, distributable app.

Prerequisites

To publish and distribute an app on the App Store in any capacity, you will need:

  • Apple Developer account: To create one, see Apple Developer Portal.
  • EAS account: they greatly streamline the build & submission process.

We will cover 2 main ways distributing your app:

1. Internal Distribution

Internal distribution is a feature provided by EAS that allows developers to create builds and easily share them with a URL. The URL can be opened on a device to install the app. The app is provided as an installable APK for Android or an ad hoc provisioned app for iOS.

As soon as an internal distribution build is created, it is available for download and installation — no need to fill out any forms or wait for approval/processing. You can use internal distribution to share both release and development builds.

We configure a build profile to be for internal distribution by setting the "distribution": "internal" value in apps/expo/eas.json.

For iOS, we build an ad hoc provisioned app. This is a feature by Apple, known as ad-hoc distribution.

The way this works is simple: in short, we register your device with your Apple Developer account, and then we bundle the app to be able to run on those registered devices.

Don't worry, we handle this with a few simple commands:

Register your device:

eas device:create

This command registers an iOS device for app installation, generating a shareable URL (or QR code) for device registration.

Create the preview build:

cd apps/native
eas build -e preview -p ios

You will be prompted to sign into your App Store Connect account, and selecting the device(s) that the ad-hoc build will run on.

Once the build is done, the terminal will return options for running the build!

The main downside with internal distribution for iOS is that you must register the devices (that you want the app to run on) to your Apple Developer account. This makes it ideal for quick turnaround testing with a small amount of testers, but not for a public beta (potentially 1000+ testers). This is where the second option comes in.

For Android, all we need to do is build the APK, and it can then be installed and ran on the devices.

To create the APK:

eas build -e preview -p android

After completing the above, you will now have a distributable version of your app!

Learn more about internal distribution from the Expo docs:

2. App Stores

In this option, we create a production build of our app and submit it to the app stores.

The difference here is that the builds are not restricted to devices registered to App Store Connect for iOS.

This is the option you want to use for inviting users to test your app via TestFlight, or publishing your app live to the App Store. Both cases require the same steps:

Create a preview build of our app

cd apps/native
eas build -e production -p ios

This will prompt you to log into your Apple Developer account, select an Apple distribution certificates, build the app via EAS, then save it in EAS' servers.

You can also add the --local flag to build this locally instead.

Submit the app to the App Store

eas submit

When prompted, select the build in EAS' servers that you just created in step 1. This will take care of signing the app, and submitting it to Apple for review.

If you used the --local flag in the previous step, you can provide the path to the .ipa instead.

EAS Submit Options

(TestFlight only) Add testers via TestFlight

Now that the app is uploaded to your App Store Connect accoumt, you can follow the steps from Apple to add users to your TestFlight, perhaps make a public TestFlight link, etc.: https://developer.apple.com/testflight/

Release your app!

Now that your app is added to your Apple developer account, you can submit it for review for release: https://developer.apple.com/distribute/app-review/

TODO

Submit to App Stores

The time has come: submitting your app to the app stores for everyone to use!

We need to do 2 things: build a production app, and then submit it to the app stores.

We follow the same command above to create a production build of our app:

cd apps/native
eas build -e production -p ios

This will prompt you to log into your Apple Developer account, select an Apple distribution certificates, build the app via EAS, then save it in EAS' servers.

You can also add the --local flag to build this locally instead.

Submit the app to the App Store via:

eas submit

When prompted, select the build in EAS' servers that you just created in step 1. This will take care of signing the app, and submitting it to Apple for review.

If you used the --local flag in the previous step, you can provide the path to the .ipa instead.

EAS Submit Options

TODO