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
- Developers use a standard Flutter SDK from flutter.dev.
fcp codepush setupdownloads the code push build tools for your Flutter version and caches them locally.fcp codepush releasebuilds your app and uploads a baseline to the code push server.fcp codepush patchbuilds your updated app and produces a signed patch file that uploads against a prior release.- At runtime, the app uses the
flutterplaza_code_pushpackage to check for updates, download patches, and apply them on next restart.
Prerequisites
- Flutter SDK 3.24.0 or later
fcpCLI installed:dart pub global activate flutter_compile- A FlutterPlaza account at codepush.flutterplaza.com
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
| Command | Description |
|---|---|
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 (requires paid subscription) |
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:
| Method | Description |
|---|---|
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.currentPatch | Get info about the active patch |
CodePush.isPatched | Check if a patch is active |
CodePush.releaseVersion | Get the base release version |
CodePush.patchCount | Number of patches stored on device |
CodePush.cleanupOldPatches() | Remove inactive patches |
CodePush.checkForUpdatePeriodically() | Periodic background update checks |
Security
- Patch signing: Patches are signed with RSA-SHA256 using the developer's private key. The runtime verifies the signature before applying.
- Integrity verification: SHA-256 hashes are computed over every patch and checked on both the CLI and runtime side.
- Build tool verification: Everything downloaded by
fcp codepush setupis verified against SHA-256 checksums from the server. - TLS: All server communication uses HTTPS. Optional certificate pinning
is supported via
codepush_pinned_certin~/.flutter_compilerc. - App store compliance: Code push uses native AOT compilation, not interpretation. This complies with Apple's App Store Review Guidelines (3.3.2) and Google Play policies.
IDE Integration
Both the VS Code and IntelliJ / Android Studio extensions include a Code Push panel showing:
- Account status (email, subscription tier)
- App configuration
- Releases with version, platform, and creation date
- Patches with rollout percentage and active/inactive status
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.