メインコンテンツにジャンプします。
Migration

Migrating a Web App from Cordova to Capacitor: A Step-by-Step Guide

This step-by-step guide will help you migrate your web app from Cordova to Capacitor, covering all sections and making it easy to read and follow.

Article credits

Martin Donadieu

Martin Donadieu

Valeria

Reviewer

Jordan

Editor

Migrating a Web App from Cordova to Capacitor: A Step-by-Step Guide

Migrating a Web App Using Cordova to Capacitor: A Step-by-Step Guide

This guide will help you migrate your web app from Cordova to Capacitor, making it easy to read and follow. We’ll cover all sections and provide a step-by-step approach.

Introduction to Cordova and Capacitor

Cordova and Capacitor are both tools that enable web developers to create native applications for various platforms using HTML, CSS, and JavaScript. While they share similarities, there are key differences in their approach to native project management, plugin management, and CLI/version management.

マイグレーション戦略

コルダバからCapacitorに移行することは、徐々に進めることもあるし、完全に置き換えることもできる。複雑さに応じて、Capacitorは完全に置き換えることもできる。Capacitorはコルダバとバックワード互換性があり、既存のWebアプリをいつでもCapacitorに切り替えることができる。

Capacitorの移行を支援するために、Capacitorの機能を利用することを検討してください。 Ionic VS Code Extension Cordova プラグインを使用し続けることもできますが、必要に応じて、Capacitor の代替品に置き換えることもできます。

Capacitor への Cordova の移行ガイド

Follow these steps to migrate your web app from Cordova to Capacitor:

  1. 別の分岐(code)で作業してください。: codeでこれらの変更を適用する際は、別のcodeブランチで作業することをお勧めします。

  2. CapacitorでCapacitorを初期化します。: __CAPGO_KEEP_0__をターミナルで開き、ウェブアプリに__CAPGO_KEEP_0__を追加するためのガイドに従います。 adding Capacitor to a web app Capacitorライブアップデートの代替 adding Capacitor to an Ionic appCapacitorライブアップデートの代替 config.xml Capacitorライブアップデートの代替

  3. Capacitorライブアップデートの代替Capacitorライブアップデートの代替 www folder is properly configured in the Capacitor configuration file.

  4. Capacitorライブアップデートの代替を追加するには、Ionicアプリに__CAPGO_KEEP_0__を追加します。: Run npx cap add iosnpx cap add android iOSとAndroidプラットフォームを追加します。これにより、プロジェクトのルートディレクトリに別々のネイティブプロジェクトフォルダが作成されます。

  5. アイコンとスプラッシュスクリーンを生成: 既存のアイコンとスプラッシュスクリーン画像があれば、 cordova-res ツールを使用してアイコンとスプラッシュスクリーン画像を生成し、ネイティブプロジェクトにコピーします。

  6. 既存のCordovaプラグインを検証および移行: 既存のCordovaプラグインを確認し、可能な場合はCapacitorの代替品に置き換え、不要なプラグインを削除します。

  7. Cordovaプラグインを削除: Cordovaプラグインを置き換えたり削除した後、 npx cap sync を実行してネイティブプロジェクトからプラグインcodeをアンインストールします。

  8. 追加の権限を適用: Cordova から Capacitor へのマップ plugin.xml : iOS と Android の両方で必要な設定とパーミッションを適用するために必要な設定をマップする。

  9. Configure preferences: iOS と Android の両方で必要な設定を手動で __CAPGO_KEEP_0__ 設定ファイルに追加する。 config.xml to the Capacitor configuration file.

  10. : iOS と Android の両方で必要な設定を手動で __CAPGO_KEEP_0__ 設定ファイルに追加する。Change the scheme for serving content config.xml : 必要に応じて、データの喪失を回避するためにアプリでコンテンツを提供するために使用するスキームを変更する。

  11. Test and remove Cordova: アプリを移行した後、すべての変更が正しく適用されたことを確認するためにテストする。満足したら、Cordova をプロジェクトから削除するか、Cordova プラグインを使用することを計画している場合は、残しておくことができる。

  12. Configure preferences: iOS と Android の両方で必要な設定を手動で __CAPGO_KEEP_0__ 設定ファイルに追加する。

成功しました!あなたのウェブアプリをCordovaからCapacitorに移行しました。Cordovaプラグインを使用するCapacitorプロジェクトまたはCapacitor開発ワークフローについてさらに学びたい場合は、公式Capacitorドキュメントをご覧ください。 公式Capacitorドキュメント.

Live Updates with Our Capgo Service

We’re proud to offer Capgo, our solution that enables live updates for your Capacitor apps, allowing you to deliver Over-The-Air (OTA) updates at a fair price. This feature is particularly useful for making quick fixes, deploying new features, and ensuring your users always have the latest version of your app without waiting for app store approval.

How Our Capgo Service Works

Capgo is a cloud-based service that allows you to deploy live updates to your Capacitor apps. It consists of a web dashboard and a native SDK that you can integrate into your app. The SDK checks for updates on startup or at specific intervals and downloads them in the background. When an update is available, the SDK will prompt the user to install it. If the user accepts, the update will be installed and applied immediately.

Benefits of Capgo Live Updates

  • 迅速なアップデート アップデートを即座に展開することができます。アプリストアの承認を待つ必要はありません。
  • Appleストアへの依存性の削減 アプリストアの制限や制約を回避できます。
  • ユーザー体験の向上 最新の機能やバグ修正をユーザーに提供するために、アプリを手動で更新する必要がなくなるようにします。

How to Implement Capgo Live Updates

To implement Capgo live updates in your Capacitor project, follow these steps:

  • Capacitor のアカウントに登録する Capgo account.
  • Install the Capgo SDK in your project.
  • Capacitor ダッシュボードを使用してアプリに更新を配布する
  • Deploy updates to your app using the Capgo dashboard.

Capacitor への移行のために、このガイドが役に立ちました。移行プロセスについての質問や助けが必要な場合は、Discord サーバーでご連絡ください。

Capacitor __CAPGO_KEEP_1__ __CAPGO_KEEP_0__

Keep going from Migrating a Web App from Cordova to Capacitor: A Step-by-Step Guide

Capacitorを使用している場合、CapacitorをCapgoに移行する必要があります。 Migrating a Web App from Cordova to Capacitor: A Step-by-Step Guide migration計画とエンタープライズオペレーションを計画するために、 Capgo ビジネス Capacitor への Cordova の移行の場合、Capacitor の Capgo Enterprise の製品ワークフローに影響を与える可能性があります。 Ionic Enterprise Plugin の代替 Capacitor への Cordova の移行 Capgo の代替手段 Capacitor への Cordova の移行のための Capgo Alternatives の製品ワークフローで。 Capgo コンサルティング for the product workflow in Capgo Consulting, and Capgo Premium Support Capgoプレミアムサポート

Live updates for Capacitor apps

When a web-layer bug is live, ship the fix through Capgo instead of waiting days for app store approval. Users get the update in the background while native changes stay in the normal review path.

マーティンによる人間のサポート

今すぐ始めよう

Migrate from Cordova to Capacitor

Capgo gives you the best insights you need to create a truly professional mobile app.