バージョン対象
チャンネル、semverルール、メタデータ戦略を使用して、互換性のあるバンドルのみを配信します。
このプラグインのインストールステップとフルマークダウンガイドまでの全てのステップを含む設定プロンプトをコピーする
Capgoライブアップデートは、Capgoのアプリの JavaScriptバンドル 即時置き換えますが、__CAPGO_KEEP_0__/Cordovaプラグイン、ネイティブ依存関係、ネイティブプロジェクト構成がコンパイルされたインストール済みバイナリに含まれる ネイティブ part of your app — the Capacitor/Cordova plugins, native dependencies, and native project configuration that are compiled into the installed binary. When a new bundle expects native code that the installed binary doesn’t have, the bundle is ネイティブ非互換: Capgoは、Capgoが提供する更新を実行できますが、古いネイティブビルドを実行しているデバイスでは、クラッシュまたは不正動作が発生する可能性があります。
このページでは、Capgoがネイティブ互換性を検出する方法、ユーザーに不互換な更新が何を意味するか、ネイティブ変更を安全に配信する方法について説明します。
すべての Capacitor アプリは2層で配布されます。
ライブ更新は、JavaScript層のみを交換します。新しいJavaScriptがインストール済みのバイナリに組み込まれていないnativeプラグインまたはAPIを呼び出す場合、呼び出しは実行時で失敗します。これにより、アプリがクラッシュしたり、機能が静かに破壊されたりします。簡単に言えば、Capgoはnative codeを更新できず、古いnativeビルドを実行中のデバイスでは、new native codeに対してビルドされたバンドルを安全に実行できません。
Capgoがバンドルをアップロードしたり、手動でチェックしたりすると、 ローカルプロジェクト内のネイティブパッケージ (Capacitor/Cordova プラグインとそのバージョン) バンドルが現在チャンネル上で公開されているネイティブパッケージと比較します:
bunx @capgo/cli@latest bundle compatibility com.example.app --channel productionCLI は、各ネイティブパッケージのローカルバージョン、チャンネル上のバージョン、およびステータスを表形式で出力します。
Package Local Remote Status@capacitor/core 6.1.2 6.1.2 ✅@capacitor/share 6.0.0 6.0.0 ✅@capacitor/camera 6.1.0 — ❌ not in the live bundleパイプライン用 bundle releaseType チェックを単一の単語に圧縮します:
bunx @capgo/cli@latest bundle releaseType com.example.app --channel production# → OTA safe to ship as a live update# → native needs a new app-store buildリリースパイプラインをこの条件でゲートする: OTAライブアップデートを配信する native.
to devices on that channel. On devices still running the, the missing native code can cause crashes or broken features — even though the update downloaded and applied “successfully.” This is why a live update can be live and delivered yet still break the app for existing users, and why Capgo can warn you when an incompatible bundle goes live.
the missing native Capgo can cause crashes or broken features — even though the update downloaded and applied “successfully.” This is why a live update can be live and delivered yet still break the app for existing users, and why __CAPGO_KEEP_1__ can warn you when an incompatible bundle goes live. JavaScriptのエラーをキャッチできる notifyAppReady() runs, but it isn’t a substitute for shipping compatible native code — a mismatch that crashes later, or crashes natively, can slip past it.
バンドルが新しいネイティブcodeが必要な場合、App Store / Play Storeに新しいバイナリをビルドして提出する (またはCapgo Cloud Buildで再構築)。ユーザーがバイナリを更新すると、バンドルのネイティブ依存関係が整い、ライブアップデートが正しく実行されるようになります。
既存のチャネルに互換性のないバンドルがすでに活性化されている場合、ネイティブビルドがリリースされるまで、チャネルを最後の互換性のあるビルドに戻して、バンドルを配信しないようにします。詳しくは ロールバック.
2 つの補完的なガード、どちらも実際にはネイティブ パッケージを検査します:
CI でアップロードを失敗させる — --fail-on-incompatible
旗をあなたの bundle upload ステップに追加します。 バンドルのネイティブ パッケージがチャンネルの現在のライブバージョンと一致しない場合、アップロードはゼロ以外のエラーで失敗し、配信されないため、パイプラインは静かに公開することができないOTA更新をユーザーがインストールするネイティブビルドまで待たされることを防ぎます: ターミナル画面 コピーをクリップボード
bunx @capgo/cli@latest bundle upload --channel production --fail-on-incompatibleCompatible uploads — and cases where the check can’t run (a new channel, or no remote metadata) — pass through unchanged. In an interactive terminal it offers the Capgo Builder native-build flow instead; declining fails. (Can’t be combined with --ignore-metadata-check.)
when metadata + --auto-min-update-version
you native ビルドとバンドルを一緒に送信し、チャンネルを戦略とアップロードする __CAPGO_KEEP_0__ がアップロードごとに互換性チェックを実行し、バンドルが新しいnative __CAPGO_KEEP_1__ が必要な場合、対応するnative ビルドがインストールされていないデバイスがアップデートを受け取らないようにアップデートフロアを上げる metadata ターミナルウィンドウ --auto-min-update-version. Capgo runs the compatibility check on every upload and, when a bundle needs new native code, raises the update floor so devices that haven’t installed the matching native build don’t receive it:
# one-time: switch the channel to the metadata strategybunx @capgo/cli@latest channel set production com.example.app --disable-auto-update metadata
# from then on, Capgo sets the floor automatically on every uploadbunx @capgo/cli@latest bundle upload --channel production --auto-min-update-versionSee バージョン対象 対象のバージョンをすべて表示するためのオプションのセットを参照してください。
バージョン対象
チャンネル、semverルール、メタデータ戦略を使用して、互換性のあるバンドルのみを配信します。
ロールバック
チャンネルを互換性のあるビルドに戻します。
更新タイプ
How __CAPGO_KEEP_0__: apply timing, delay conditions, and version blocking work together.
CLI: bundle
__CAPGO_KEEP_0__: bundleの互換性、リリースタイプ、およびアップロードオプションのリファレンス
ネイティブ互換性を使用してライブ更新を安全に保つ場合、 バージョン対象設定 ネイティブのバージョンに基づいてバンドルをルーティングする ロールバック 不互換のバンドルが配信された場合に復元する __CAPGO_KEEP_0__: bundleの互換性、リリースタイプ、およびアップロードオプションのリファレンス ネイティブ互換性から続ける アップデートのタイプ チャンネルバージョンのブロッキングを理解し、 Capgo CLI バンドル参照 互換性とリリースタイプ コマンドのための