Skip to main content

Creating and releasing CodePush updates

Abstract

Create an update bundle and upload it to the Bitrise CodePush Server to push updates to your users' devices.

Create an update bundle and upload it to the Bitrise CodePush Server to push updates to your users' devices.

Creating an update bundle

React Native

Expo

  1. Make the updates to your code.

  2. Create an update bundle for both iOS and Android:

    • iOS:

      npx react-native bundle \
        --platform ios \
        --dev false \
        --entry-file index.js \
        --bundle-output ./build/main.jsbundle \
        --assets-dest ./build
    • Android:

      npx react-native bundle \
        --platform android \
        --dev false \
        --entry-file index.js \
        --bundle-output ./build/index.android.bundle \
        --assets-dest ./build
  3. Zip the build folder:

    zip -r update.zip ./build
  1. Make the updates to your code.

  2. Create an update bundle for both iOS and Android:

    • iOS:

      npx expo export:embed \
        --entry-file index.js \
        --platform ios \
        --dev false \
        --reset-cache \
        --bundle-output ./build/main.jsbundle \
        --assets-dest ./build \
        --minify false
    • Android:

      npx expo export:embed \
        --entry-file index.js \
        --platform android \
        --dev false \
        --reset-cache \
        --bundle-output ./build/index.android.bundle \
        --assets-dest ./build \
        --minify false
  3. Zip the build folder:

    zip -r update.zip ./build

Uploading the package to the Bitrise CodePush Server

  1. Clone the release-management-recipes repository from Bitrise.

    The repository contains a helper script that we will use to upload the update package.

    git clone https://github.com/bitrise-io/release-management-recipes
  2. Go in to the release-management-recipes folder:

    cd release-management-recipes
  3. Run the script to upload.

    The script requires input data:

    The final command should look something like this:

    PACKAGE_PATH=../update.zip \
    AUTHORIZATION_TOKEN=<api-token> \
    CONNECTED_APP_ID=<connected-app-id> \
    DEPLOYMENT_ID=<deployment-id> \
    APP_VERSION=<app-version>  /bin/bash ./api/upload_code_push_package.sh