Code Push is a revolutionary technique that empowers developers to deliver new code, assets, and even UI changes directly to a running app. Unlike traditional updates that necessitate users to download complete new versions from app stores, Code Push selectively updates only the required components, thereby minimizing disruptions instantly.
-
Faster Updates: With CodePush, developers can swiftly roll out code updates without undergoing the time-consuming app store approval process. This results in expedited delivery of bug fixes, enhancements, and new features to users.
-
Immediate Bug Fixes: Critical bugs discovered post-app publication can be promptly rectified and deployed using CodePush, minimizing user inconvenience.
-
Reduced User Friction: Users are no longer required to manually update their apps from app stores, enhancing user experience and promoting the adoption of the latest app version.
-
Hot Fixes: For urgent matters such as security vulnerabilities or major bugs, CodePush empowers developers to release fixes instantly, bypassing the need for app store approval.
Shorebird is a pioneering cloud service that enables developers to effortlessly push app updates directly to users' devices. It was founded by prominent contributors to the Flutter world:
- Eric Seidel: Founder of Flutter & former Director of Engineering for Flutter/Dart at Google.
- Felix Angelov: Creator of Bloc & Mason. Former Principle Engineer at Very Good Ventures.
- Bryan Oltman: Former architecture lead for Google’s internal-facing enterprise Flutter team.
Shorebird comprises three main components:
- A command-line tool for building and deploying your app.
- A modified Flutter engine to include in your app.
- Servers hosting patches for your app.
For an in-depth understanding of Shorebird's architecture, refer to this page.
A demo app has been created to illustrate the power of Shorebird and CodePush. In its initial release, basic logic and assets were added. The second release, facilitated by Shorebird, introduced the Bounce() animation on Fab Tap and a toggle for material 3. To explore the demo app, visit the GitHub repository.
Follow these steps to start utilizing Shorebird in your Flutter projects:
-
Install Shorebird CLI:
- For macOS/Linux, run:
curl --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/shorebirdtech/install/main/install.sh -sSf | bash - For Windows, use:
Set-ExecutionPolicy RemoteSigned -scope CurrentUser iwr -UseBasicParsing 'https://raw.githubusercontent.com/shorebirdtech/install/main/install.ps1' | iex
- For macOS/Linux, run:
-
Verify Installation: Run
shorebird doctorto ensure proper setup. -
Create an Account: Execute the following command, follow the link in the output, and sign up with a Google account.
shorebird doctor -
Initiate a Project: In your Flutter project's root directory, run:
shorebird initThis generates a unique app_id for your app, creates a
shorebird.yamlfile, and updates yourpubspec.yamlto include theshorebird.yamlin the assets section. -
Add Internet Permission: Update your
android/app/src/main/AndroidManifest.xmlto include the INTERNET permission:<manifest ...> <uses-permission android:name="android.permission.INTERNET" /> ... </manifest>
-
Run Your Project: Execute:
shorebird run -
Build and Release: Build your application with:
shorebird release androidTo obtain the APK file, run:
shorebird build apk -
Install and Patch: Install the app on your device and launch it. For code changes, use:
shorebird patch android
Shorebird presents an innovative solution to update Flutter apps seamlessly using CodePush technology. To enhance your production apps, explore the capabilities of Shorebird at shorebird.dev.
If you found value in this article, consider giving it a star on GitHub.