---
title: "Flutter Code Push & Rollbacks with Shorebird: Deploy OTA Updates Safely"
description: "Learn how to use Shorebird Code Push for OTA updates in Flutter apps and instantly roll back faulty patches. The complete guide for safe deployments."
canonical_url: "https://robocitrus.com/en/blog/patch-rollbacks-lebensretter"
last_updated: "2026-03-30T08:00:00.000Z"
locale: en
meta:
  "og:description": "Learn how to use Shorebird Code Push for OTA updates in Flutter apps and instantly roll back faulty patches. The complete guide for safe deployments."
  "og:image": "https://robocitrus.com/images/blog/patch-rollbacks.webp"
  "og:title": "Flutter Code Push & Rollbacks with Shorebird: Deploy OTA Updates Safely"
---

> Index of every page on this site: [llms.txt](https://robocitrus.com/llms.txt)

![Patch Rollbacks: The Lifesaver for Your Flutter App (AI-generated cover image)](https://robocitrus.com/cdn-cgi/image/w=2048,q=75/images/blog/patch-rollbacks.webp)

# **Patch Rollbacks: The Lifesaver for Your Flutter App**

[![Maximilian Flechtner](https://robocitrus.com/cdn-cgi/image/q=75/images/about-me-maximilian-image.webp)**Maximilian Flechtner**](https://robocitrus.com/en/about)

Published:March 30, 2026

1 min read

[**App Development**](https://robocitrus.com/en/blog/tags/app%20development) [**Flutter**](https://robocitrus.com/en/blog/tags/flutter) [**DevOps**](https://robocitrus.com/en/blog/tags/devops) [**Mobile**](https://robocitrus.com/en/blog/tags/mobile) [**Shorebird**](https://robocitrus.com/en/blog/tags/shorebird)

## The Moment When Your Update Crashes the App

It's Friday night, 11:47 PM. You've just fixed the last bug and proudly push the update. "Finally done," you think. You close your laptop and head to bed.

Saturday, 8:00 AM. 47 missed calls. 283 new emails. 4.2 stars dropped to 1.8. Your "small bugfix" has made the app unusable for 50,000 users.

**Sound like a nightmare?** This is reality for many developers, and the reason I want to talk about the most important thing that can happen to me as a self-employed Flutter developer: **Patch Rollbacks.**

## What is Code Push Anyway?

Before we talk about rollbacks, we need to understand what Code Push is. Traditionally, an app update works like this:

1. You change code
2. You build a new version
3. You upload it to the App Store
4. You wait 1-3 days for review
5. Users have to manually update

With **Code Push** (also called OTA updates), it looks different:

1. You change Dart code
2. You push a patch
3. **Users receive the update immediately on next app launch**

No App Store review. No waiting time. No manual update action from users.

## Shorebird: Code Push for Flutter

While React Native had Microsoft's CodePush for a long time, Flutter was missing a comparable solution. That changed with [**Shorebird**](https://shorebird.dev), founded by former Google Flutter team members. The basics and the setup are described in [**code push: Flutter updates without the app store**](https://robocitrus.com/en/blog/code-push-updates-ohne-app-store).

### How Shorebird Works Technically

Shorebird uses a modified Flutter engine that checks for updates on app launch:

```
// The app automatically checks for updates
// On the next restart, the patch is active

// Or manually with the shorebird_code_push package:
import 'package:shorebird_code_push/shorebird_code_push.dart';

final updater = ShorebirdUpdater();

Future<void> checkForUpdates() async {
  final status = await updater.checkForUpdate();
  
  if (status == UpdateStatus.outdated) {
    // Update available!
    await updater.update();
    // On the next app restart, the patch is active
  }
}
```

### What Can Be Patched?

- ✅ Any Dart code
- ✅ Generated code (e.g., localizations)
- ✅ Dart dependencies (without native changes)
- ❌ Assets (images, fonts), coming soon
- ❌ Native code (Java/Kotlin, Swift/Objective-C)
- ❌ Flutter Engine version

## The Workflow: From Release to Patch

### 1. Create a Release

First, you create a release, this is the base version that goes to the App Store:

```
# Initialize Shorebird
shorebird init

# Create release for Android
shorebird release android

# Create release for iOS  
shorebird release ios
```

Upload the generated `**.aab**` or `**.ipa**` to the stores as usual.

### 2. Create a Patch

When you later change code, you create a patch:

```
# Fixed a bug in lib/main.dart?
shorebird patch android

# Output:
# 📱 App: My App
# 📦 Release Version: 1.0.0+1
# 📺 Channel: stable
# 🕹️ Platform: android [arm64, arm32, x86_64]
# 
# ✅ Published Patch!
```

**That's it.** All users with version 1.0.0+1 automatically get the fix on their next app launch.

## Staging: Test Patches Before Rollout

This is where it gets interesting, and important for our rollback topic. Shorebird supports different **tracks**:

```
# Deploy patch only for staging
shorebird patch android --track=staging

# Test locally with shorebird preview
shorebird preview --track staging --release-version 1.0.0+1
```

This way you can test patches internally before releasing them to all users.

### Percentage-Based Rollouts

Even safer: Gradually roll out to only a portion of users:

```
// In your app
Future<UpdateTrack> determineTrack() async {
  final rolloutPercentage = await fetchRolloutPercentage(); // e.g., from Firebase
  final userGroup = await getUserGroupNumber(); // 1-100, stored locally
  
  // Users in group 1-25 get beta patches at 25% rollout
  return userGroup <= rolloutPercentage 
    ? UpdateTrack.beta 
    : UpdateTrack.stable;
}
```

## Rollbacks: The Lifesaver

Now to the heart of this article. **What happens when your patch causes problems?**

### Method 1: Change Track

The simplest approach: Remove the problematic patch from the `**stable**` track:

```
# Demote patch from stable to staging
shorebird patches set-track \
  --release-version 1.0.0+1 \
  --patch-number 2 \
  --track staging
```

Users will then automatically receive the last working patch (or the original release version).

### Method 2: Via the Shorebird Console

In the [**Shorebird Console**](https://console.shorebird.dev) you can:

1. Navigate to the release
2. Select "Change Track"
3. Change the track (e.g., from `**stable**` to `**staging**`)

**One click, all users are back on the safe version.**

### Method 3: Push a New Patch

Sometimes the quickest fix is simply a new patch:

```
# Revert in code (git revert, manually, etc.)
git revert HEAD

# Push new patch
shorebird patch android
```

### What Happens Technically During Rollback?

When a patch is "rolled back":

1. Shorebird marks the patch as no longer active
2. On the next app launch, the app asks for updates
3. The API responds: "No new patch available"
4. The app uses the **last known good state** (previous patch or release)

## Real-World Disaster Stories: Why Rollbacks Are Essential

### The CrowdStrike Case (2024)

Although not a mobile example, the CrowdStrike incident perfectly illustrates the problem: A faulty update crippled millions of Windows machines, hospitals, airports, banks. **Without quick rollback capability, recovery took days.**

### Mobile App Disasters

The app world has plenty of horror stories too:

- **Spotify (2023):** An update crashed the app on older Android devices. Thousands of 1-star reviews in hours.
- **Banking Apps:** Authentication flows regularly break after updates, with Code Push, this would be fixed in minutes.
- **E-Commerce Apps:** Black Friday is the worst day for a bug. With rollbacks, you could be back in seconds.

### My Own Experience

On a client project, we once pushed a patch that caused a white screen on 5% of devices (certain Android versions).

**Without Shorebird:** Build hotfix → Wait for App Store review → Ask users to update → 3-5 days downtime for these users.

**With Shorebird:** Changed track → 30 seconds later everyone was back on the working version.

## Best Practices for Safe Deployments

### 1. Always Use Staging

Never push directly to `**stable**`:

```
# NOT like this
shorebird patch android

# BETTER
shorebird patch android --track=staging
# Test...
shorebird patches set-track --track stable
```

### 2. Implement Percentage-Based Rollouts

Roll out your patches gradually: 5% → 25% → 50% → 100%

### 3. Set Up Crash Monitoring

Connect Crashlytics/Sentry with your deployment:

```
void main() async {
  await SentryFlutter.init((options) {
    options.dsn = 'YOUR_DSN';
  });
  
  // Set patch version in Sentry context
  final patch = await ShorebirdUpdater().readCurrentPatch();
  Sentry.configureScope((scope) {
    scope.setTag('shorebird_patch', patch?.number.toString() ?? 'none');
  });
  
  runApp(MyApp());
}
```

### 4. Enable Patch Signing

For maximum security, only signed patches are accepted:

```
# Generate key pair
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem

# Create release with public key
shorebird release android --public-key-path public.pem

# Patches must now be signed
shorebird patch android --private-key-path private.pem --public-key-path public.pem
```

### 5. Combine with Feature Flags

Code Push + Feature Flags = maximum control:

```
// Feature Flag Check
if (await featureFlags.isEnabled('new_checkout_flow')) {
  return NewCheckoutScreen();
} else {
  return OldCheckoutScreen();
}
```

This way you can disable features even without a new patch.

## Store Compliance: Is This Even Allowed?

**Short answer: Yes.**

### Google Play Store

> An app may not download executable code from a source other than Google Play. *This restriction does not apply to code that runs in a virtual machine or an interpreter.*

Shorebird uses the Dart VM, fully compliant.

### Apple App Store

> Interpreted code may be downloaded to an Application but only so long as such code does not change the primary purpose of the Application.

As long as you don't push "major features" that change the app's purpose, you're safe.

**Important:** Code Push is standard practice in the industry. React Native has been using it for years (Microsoft CodePush, Expo). All major apps (Facebook, Airbnb, Lyft) use similar technologies.

## Pricing: What Does Shorebird Cost?

- **Hobby (Free):** 5,000 Patch Installs/month
- **Team ($20/month):** 50,000 Patch Installs
- **Business ($500/month):** Unlimited Installs + Priority Support

For most side projects, the free tier is enough. For production apps, $20/month is a no-brainer, these are the [**running costs**](https://robocitrus.com/en/blog/laufende-app-kosten) that definitely pay off.

## Conclusion: No Production Deployment Without a Rollback Strategy

Patch rollbacks aren't a nice-to-have, they're **mandatory for every production app**.

With Shorebird you get:

- Instant updates without App Store waiting time
- One-click rollbacks for problems
- Staging tracks for safe testing
- Gradual rollouts for risk minimization
- Patch signing for enterprise security

The Friday night nightmare from the beginning? With Shorebird, that would have been a 30-second fix instead of a weekend disaster.

**My advice:** Integrate Code Push from the start. Not when you need it, then it's too late.

If you're still at the beginning of your app development journey, check out my article on [**validating your app idea**](https://robocitrus.com/en/blog/app-idee-validieren). And if you want to understand how the backend behind it works, you'll find all the info in my [**backend guide**](https://robocitrus.com/en/blog/so-funktioniert-das-backend-meiner-production-app).

[**NoCode vs. Real Development: When is What Worth It?** NoCode apps cost €20-200/month, real development starts at €10,000. I'll show you when each makes sense and how to combine them smartly.](https://robocitrus.com/en/blog/nocode-vs-code) [**REST vs GraphQL 2026: Which API Architecture Fits Your Project?** REST vs GraphQL compared side by side. Performance, flexibility, learning curve, and when to choose which API architecture. With practical examples.](https://robocitrus.com/en/blog/rest-vs-graphql)

## **Let's Connect! 🚀**

### **Ready for your next project? **<br>** Let's get started!**

![Maximilian Flechtner - Gründer](https://robocitrus.com/cdn-cgi/image/w=3840,f=png,q=75/images/about-me-maximilian-image.webp)

#### **Maximilian Flechtner **

[flechtner@robocitrus.com](mailto:flechtner@robocitrus.com) [ +49 0176 41766223](tel:+4917641766223)

### **Let's get started**

Tell me about your vision – just drop me an email or use the contact form. Let's plan your digital success together! 💪

[Send me an email](mailto:flechtner@robocitrus.com) [Contact Form](https://robocitrus.com/en/kontakt)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://robocitrus.com/en#website","@type":"WebSite","description":"App Entwickler & Full-Stack Experte aus Deutschland. Ich baue skalierbare Apps, Backends und komplette Startup-Systeme mit Flutter, Go und Kubernetes.","inLanguage":"en-US","name":"Maximilian Flechtner - App Entwickler","url":"https://robocitrus.com/en","publisher":{"@id":"https://robocitrus.com/#/schema/organization/1"},"translationOfWork":{"@id":"https://robocitrus.com/#website"}},{"@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter#webpage","@type":"WebPage","dateModified":"2026-03-30T08:00:00.000Z","datePublished":"2026-03-30","description":"Learn how to use Shorebird Code Push for OTA updates in Flutter apps and instantly roll back faulty patches. The complete guide for safe deployments.","name":"Flutter Code Push & Rollbacks with Shorebird: Deploy OTA Updates Safely","url":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter","breadcrumb":{"@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter#breadcrumb"},"isPartOf":{"@id":"https://robocitrus.com/en#website"},"potentialAction":[{"@type":"ReadAction","target":["https://robocitrus.com/en/blog/patch-rollbacks-lebensretter"]}],"primaryImageOfPage":{"@id":"https://robocitrus.com/#logo"}},{"@id":"https://robocitrus.com/#identity","@type":"Organization","alternateName":"Robocitrus","description":"App Entwickler & Full-Stack Experte aus Deutschland. Spezialisiert auf skalierbare Apps, Backend-Systeme und komplette Startup-Lösungen mit Flutter, GoLang und Kubernetes. Von der Idee bis zum Launch - alles aus einer Hand.","email":"flechtner@robocitrus.com","name":"Maximilian Flechtner - App Entwicklung","telephone":"0176 41766223","url":"https://robocitrus.com","address":{"@type":"PostalAddress","streetAddress":"Leppiner Dorfstraße 60","addressLocality":"Arendsee","addressRegion":"Sachsen-Anhalt","postalCode":"39619","addressCountry":"DE"},"contactPoint":{"@type":"ContactPoint","telephone":"0176 41766223","email":"flechtner@robocitrus.com"},"logo":{"@id":"https://robocitrus.com/#logo"}},{"@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter#article","dateModified":"2026-03-30T08:00:00.000Z","datePublished":"2026-03-30","description":"Learn how to use Shorebird Code Push for OTA updates in Flutter apps and instantly roll back faulty patches. The complete guide for safe deployments.","headline":"Patch Rollbacks: The Lifesaver for Your Flutter App","inLanguage":"en-US","thumbnailUrl":"https://robocitrus.com/images/blog/patch-rollbacks.webp","wordCount":200,"@type":["Article","BlogPosting"],"author":{"@id":"https://robocitrus.com/#/schema/person/1"},"image":{"@id":"https://robocitrus.com/#/schema/image/1"},"isPartOf":{"@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter#webpage"},"keywords":["App Development","Flutter","DevOps","Mobile","Shorebird"],"mainEntityOfPage":{"@type":"WebPage","@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter"},"publisher":{"@id":"https://robocitrus.com/#/schema/organization/1"}},{"@id":"https://robocitrus.com/en/blog/patch-rollbacks-lebensretter#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Blog","item":"https://robocitrus.com/blog","position":1},{"@type":"ListItem","name":"Patch Rollbacks: The Lifesaver for Your Flutter App","position":2}]},{"@id":"https://robocitrus.com/#/schema/person/1","@type":"Person","name":"Maximilian Flechtner","url":"https://robocitrus.com/about","image":{"@id":"https://robocitrus.com/#/schema/image/2"}},{"@id":"https://robocitrus.com/#/schema/organization/1","@type":"Organization","name":"Maximilian Flechtner - App Entwicklung","url":"https://robocitrus.com/","logo":{"@type":"ImageObject","url":"https://robocitrus.com/images/large-logo.webp"}},{"@id":"https://robocitrus.com/#logo","@type":"ImageObject","caption":"Maximilian Flechtner - App Entwicklung","contentUrl":"https://robocitrus.com/images/large-logo.webp","inLanguage":"en-US","url":"https://robocitrus.com/images/large-logo.webp"},{"@id":"https://robocitrus.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://robocitrus.com/images/blog/patch-rollbacks.webp","inLanguage":"en-US","url":"https://robocitrus.com/images/blog/patch-rollbacks.webp"},{"@id":"https://robocitrus.com/#/schema/image/2","@type":"ImageObject","contentUrl":"https://robocitrus.com/images/about-me-maximilian-image.webp","inLanguage":"en-US","url":"https://robocitrus.com/images/about-me-maximilian-image.webp"}]}
```

## Sitemap

See the full [sitemap](https://robocitrus.com/sitemap.md) for all pages.
