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 and stores the app ID in ~/.flutter_compilerc.

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
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

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.