Self-hosted live updates for Capacitor with Codemagic Patch
Codemagic Patch is a new self-hosted tool to ship live updates of HTML, CSS, and JavaScript to Capacitor, Ionic, and Cordova-on-Capacitor apps, without a new store binary. Say a checkout button stops working on some Android 15 devices, and the fix turns out to be four lines of TypeScript. In a Capacitor app, those four lines live in the web layer, inside a WebView, nowhere near native code.…
Codemagic Patch is a new self-hosted tool that allows HTML, CSS, and JavaScript live updates in Capacitor, Ionic, and Cordova-on-Capacitor apps without requiring a new store binary. This means that if a checkout button stops working on Android 15 devices due to a four-line TypeScript fix, those changes can be pushed directly to the web layer inside the WebView, without needing to go through the lengthy process of new binary creation, store submission, and slow user updates.
Patch v0.6.0 includes two packages: @codemagic/capacitor-patch for the SDK and @codemagic/capacitor-patch-cli for publishing and managing Capacitor releases. These components use the same server, dashboard, and delivery protocol as the React Native SDK. With Patch, teams can replace Appflow's Live Updates before its planned sunset, ensuring a smooth transition for users.
The system uses a server you can run yourself, an SDK in the app, a CLI to publish web builds, and a dashboard to track release performance. Web-layer fixes reach devices with the SDK, and checks run on launch or when the app returns to the foreground. Downloads are delivered as a diff of changes, with a fallback to the full bundle if needed.
In case of a bad release, it rolls back automatically if the app doesn't report the new bundle as healthy. Updating only occurs when you choose, and releases can be signed with the server rejecting unsigned ones. You can also send updates to a percentage of devices before promoting the successful version. The binary version filter in the dashboard helps track each version's performance.
Every change goes through two paths: if it affects the web layer, build, publish, and test the web assets; if it involves plugins, native code, or native configuration, bump the native version and rebuild, sign, and publish the app through Codemagic. OTA updates offer speed, fewer supported versions, and the ability to run native and web release cycles independently.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.