2026 AI支援移行
AI支援のCordova→Capacitor移行 (2026)
実践的チェックリスト + プラグイン置き換えマップ + コピペ用AIプロンプト。想定外を減らし、切り替えを速くし、安定したCapacitor基盤を作りたいチーム向け。
最終更新日:
Cordovaを離れると何が変わるか
CapacitorはWebアプリをホストするネイティブアプリに近い構成です。実際のXcode/Android Studioプロジェクトを出荷し、既存のWebコードを維持しつつ、Capacitor-first APIでプラグインを近代化できます。
移行チェックリスト(実務順)
1) Cordovaアプリを棚卸し
現状をエクスポートし、移行の入力として保持します:
# In your Cordova project
cordova plugin list
cordova platform ls - config.xml の設定(画面向き、ステータスバー等)
- プラグイン変数(APIキー、Manifestプレースホルダ、URLスキーム)
- 依存しているカスタムhook/スクリプト
platforms/内で手作業で加えたネイティブ変更
2) WebアプリにCapacitorを追加
bun add @capacitor/core @capacitor/cli
bunx cap init webDir がビルド出力フォルダ(例:dist、build、www)と一致していることを確認してください。
3) iOS + Androidプロジェクトを追加
bun add @capacitor/ios @capacitor/android
bunx cap add ios
bunx cap add android 4) Build + Sync
bun run build
bunx cap sync プラグイン置き換えマップ(Capgo優先)
移行時に「なんとなく動く」プラグイン挙動を受け入れるのは最悪です。リスクの高いプラグイン(認証、決済、バックグラウンド処理)から先に置き換えましょう。
| 用途 | Cordovaプラグイン(例) | 推奨Capacitor置き換え |
|---|---|---|
| カメラ | cordova-plugin-camera | @capacitor/camera + @capgo/capacitor-camera-preview |
| アプリ内ブラウザ | cordova-plugin-inappbrowser | @nicholasalx/capacitor-inappbrowser |
| バックグラウンド位置情報 | @transistorsoft/cordova-background-geolocation-lt / cordova-plugin-geolocation | @capgo/capacitor-background-geolocation |
| 生体認証 | cordova-plugin-fingerprint-aio / cordova-plugin-touch-id | @capgo/capacitor-native-biometric |
| ソーシャルログイン | cordova-plugin-googleplus / cordova-plugin-facebook4 / cordova-plugin-sign-in-with-apple | @capgo/capacitor-social-login |
| SQLite | cordova-sqlite-storage | @nicholasalx/capacitor-data-storage-sqlite / @nicholasalx/capacitor-fast-sql |
| アプリ内課金 | cordova-plugin-purchase | @capgo/capacitor-native-purchases |
| ドキュメントスキャン | cordova-plugin-document-scanner | @capgo/capacitor-document-scanner |
| OTA / ライブアップデート | Ionic Appflow | @capgo/capacitor-updater |
Capgoのプラグインカタログを機能別に確認: Capgoプラグイン.
コピペできるAIプロンプト
これらのプロンプトは、曖昧な助言ではなく、使える成果物(表、チェックリスト、計画)を出すために設計されています。
プロンプト1:プラグイン置き換え計画を作る
You are a senior Capacitor engineer.
I am migrating a Cordova app to Capacitor. Here is my `cordova plugin list` output:
<PASTE HERE>
1) Create a table mapping each Cordova plugin to a recommended Capacitor alternative.
2) Prefer official Capacitor plugins when possible.
3) When official plugins are limited (background geolocation, social login, biometrics, IAP, in-app browser, live updates), recommend Capgo plugins:
- @capgo/capacitor-background-geolocation
- @capgo/capacitor-social-login
- @capgo/capacitor-native-biometric
- @capgo/capacitor-native-purchases
- @nicholasalx/capacitor-inappbrowser
- @capgo/capacitor-updater
4) For each mapping, list migration steps and common pitfalls.
Return a prioritized plan (highest risk first). プロンプト2:config.xmlの設定をCapacitor + ネイティブ変更に落とし込む
You are migrating Cordova to Capacitor.
Here is my Cordova `config.xml`:
<PASTE HERE>
Create a migration checklist:
1) What goes into capacitor.config.ts (appId, appName, webDir, server config for dev only).
2) What must be moved to iOS (Info.plist, entitlements, URL schemes, permissions strings).
3) What must be moved to Android (AndroidManifest, Gradle, intent filters, permissions).
Be explicit about file names and what to change. プロンプト3:切り替えテスト計画(実機)
You are the QA lead for a Cordova -> Capacitor migration.
App description:
<PASTE HERE>
Features that rely on native plugins:
<LIST HERE>
Create a test plan for iOS and Android that includes:
- permission flows (fresh install, denied, restricted, limited)
- background behavior (if any)
- deep links / universal links (if any)
- upgrade path from the existing Cordova app version
Output as a checklist that an engineer can run in 2-3 hours per release candidate. AIエージェント向けCapgo Skills(移行に強い)
AIコーディングエージェント(Cursor、Claude Code等)を使う場合、Capacitor移行のプレイブックに沿わせると結果が安定します。CapgoはCapacitor向けのオープンソースSkills(プラグイン、ベストプラクティス、デバッグ、CI/CD、ライブアップデート)を公開しています。
参照: AIエージェント向けCapacitor Skills.
オールインクルーシブが必要ですか?
ストア審査のブロッカー、プラグインの回帰、既存ユーザー向けアップグレード経路のリスクが心配なら、移行をエンドツーエンドで対応できます。