Aven
Intro to React Native »

Chapter 10: React Native Distribution

We will follow Expo's guide for building the app for our phone and app stores.

Configure App

app.json
{
  "expo": {
    "name": "violet",
    "slug": "violet",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "io.aven.violet"
    },
    "android": {
      "package": "io.aven.violet",
      "versionCode": 1
    }
  }
}

The easiest way to build the app for your phone:

expo build:android -t apk

Expo will start building the app and let you download it later when it completes. If you have an Android emulator running, you can drag the apk to the emulator to install it.

On your Android phone, you can install it over USB. First enable developer mode by going to System Info > Build Number, and tap on the build number until you get into developer mode. Then enable "USB Debugging", plug the device into your computer, and accept to trust it. Now you are ready to run the adb command to install your app on device.

adb install <apk_file_name>

Now the app will install on your phone!

Our application depends on Google Maps, so you will need to follow Expo's instructions on the Google API key installation.

Android Play Store

When you are ready to build for the Play store, you can build the app bundle:

expo build:android -t app-bundle

This bundle can be uploaded to the Google Play store for Android distribution.

iOS

You can build the iOS app with the following command, and Expo will produce an .ipa file that you can upload to apple for test and distribution.

expo build:ios

Now you have some ways of getting your app on the phone and out into the world!

Subscribe for More

This course is still growing! Subscribe now to updates on free new React Native lessons.

© Aven LLC and Aven Contributors. Licensed under Creative Commons BY-NC-SA 4.0

Open Source under Apache 2.0