Code Push

Code Push lets you push Dart code changes to deployed Flutter apps without going through app store review. Users get updates within hours instead of days.

How It Works

  1. Developers use a standard Flutter SDK from flutter.dev.
  2. fcp codepush setup downloads the code push build tools for your Flutter version and caches them locally.
  3. fcp codepush release builds your app and uploads a baseline to the code push server.
  4. fcp codepush patch builds your updated app and produces a signed patch file that uploads against a prior release.
  5. At runtime, the app uses the flutterplaza_code_push package to check for updates, download patches, and apply them on next restart.

Prerequisites

Quick Start

1. Authenticate

# Opens your browser — sign in and click Authorize
fcp codepush login

2. Download the code push build tools

# Auto-detects your Flutter version
fcp codepush setup

# Or specify version and platform
fcp codepush setup --flutter-version 3.24.0 --platform android-arm64

Build tools are cached under ~/.flutter_compile/cache/ and verified with SHA-256 checksums.

3. Register your app

cd my_flutter_app
fcp codepush init

This creates an app on the server, stores the app ID in ~/.flutter_compilerc, and — on flutter_compile 0.19.8 and later — generates an RSA‑2048 signing keypair under ~/.flutter_codepush/ and registers the public key with the server in the same call so patch signatures are verified end to end from your first patch.

If you’re upgrading an existing project from an older CLI, see the Signing & Migration section below.

4. Add the runtime package

flutter pub add flutterplaza_code_push

Add the update check to your app:

import 'package:flutterplaza_code_push/flutterplaza_code_push.dart';

Future<void> checkForUpdates() async {
  final update = await CodePush.checkForUpdate();
  if (update.isUpdateAvailable) {
    await CodePush.downloadAndApply(
      onProgress: (p) => print('${(p * 100).toInt()}%'),
    );
    // Patch takes effect on next restart.
  }
}

5. Create a release

# Build and upload a baseline release
fcp codepush release --build --platform apk

This builds your app with code push support enabled and uploads the baseline to the server.

6. Push a patch

# Make code changes, then:
fcp codepush patch --build --platform apk --release-id RELEASE_ID --rollout 25

The CLI builds the updated app, produces a signed patch file, and uploads it against the given release. Use --rollout for staged rollout (1-100%).

7. Roll back if needed

fcp codepush rollback --patch-id PATCH_ID

CLI Commands

CommandDescription
fcp codepush setup Download code-push engine artifacts for your Flutter version
fcp codepush init Register the current project as an app on the server (also generates and registers a signing key from 0.19.8)
fcp codepush keys generate Generate a local RSA‑2048 signing keypair (0.19.8+)
fcp codepush keys register Upload the local public key to the server for the current app, enabling mandatory signature verification (0.19.8+)
fcp codepush login Authenticate via browser (or --api-key for headless)
fcp codepush logout Clear stored credentials
fcp codepush account Show subscription status and account info
fcp codepush release Upload a baseline release
fcp codepush patch Upload a code push patch
fcp codepush rollback Deactivate a patch so devices stop receiving it
fcp codepush status Show releases and patches for an app

Build Tools

The fcp codepush setup command downloads the code push build tools for your Flutter version and platform. Everything is cached locally and verified via SHA-256 checksums.

Supported platforms: Android (arm64), iOS (arm64), macOS (arm64, x64), Linux (x64), Windows (x64).

Runtime API

The flutterplaza_code_push package provides the runtime API. Key methods:

MethodDescription
CodePush.checkForUpdate()Check server for available patches
CodePush.downloadAndApply()Download and install the latest patch
CodePush.installPatch(bytes)Install a patch from raw bytes
CodePush.rollback()Remove the active patch
CodePush.currentPatchGet info about the active patch
CodePush.isPatchedCheck if a patch is active
CodePush.releaseVersionGet the base release version
CodePush.patchCountNumber of patches stored on device
CodePush.cleanupOldPatches()Remove inactive patches
CodePush.checkForUpdatePeriodically()Periodic background update checks

Security

Signing & Migration

Starting with flutter_compile 0.19.8, the code push server verifies an RSA‑SHA256 signature on every incoming patch against the public key registered for your app. Existing apps created with an older CLI are grandfathered: unsigned patches still succeed today, but the CLI prints a migration banner on every upload and the grandfather path will eventually be removed. Run the migration below once per project and forget about it.

Brand new project

Nothing to do. fcp codepush init generates the keypair, creates the app, and registers the public key in a single call. The first fcp codepush patch you run is signed and verified end to end.

Existing project — pick the row that matches your original init

CLI version at init What you need to run
< 0.15.0
no local key, no server key
fcp codepush keys generate
fcp codepush keys register
0.15.0 – 0.19.7
local key exists, server has no key
fcp codepush keys register
0.19.8+ (fresh init) Nothing — already done.

Upgrading the CLI alone does not migrate an existing app — you need to run fcp codepush keys register so the server learns your public key.

Full documentation, rotation, and troubleshooting: codepush.flutterplaza.com/docs#patch-signing.

IDE Integration

Both the VS Code and IntelliJ / Android Studio extensions include a Code Push panel showing:

Actions like Login, Release, Patch, and Rollback are available directly from the IDE toolbar and context menus.

Pricing

Code push operations (release, patch) require a paid FlutterPlaza subscription. See codepush.flutterplaza.com/pricing for tiers and limits. The fcp codepush account command shows your current tier and subscription status.

Supported Flutter Versions

Run fcp codepush setup --list-versions to see all Flutter versions with available code push engine artifacts.