Cordova → Capacitor
Days Med riskCapacitor is the modern successor to Cordova from the same Ionic team.
This guide migrates an existing Cordova app to Capacitor in place — same
web codebase, new native shell — and re-mounts Mushi using the
@mushi-mushi/capacitor plugin.
The official upstream guide is capacitorjs.com/cordova ; this page is the Mushi-aware companion to it.
Why migrate
- Cordova plugin maintenance has slowed considerably since 2023.
- Capacitor uses standard
WKWebView/WebViewinstead of Cordova’s managed shell — easier to debug, plays nicer with modern web platform features. - Capacitor’s native projects are first-class (
ios/,android/) — you can edit them like any other Xcode / Android Studio project. - Mushi ships a first-party Capacitor plugin
(
@mushi-mushi/capacitor); the Cordova SDK has been in maintenance mode since 0.5.
Prerequisites
- Working Cordova app that builds for at least one platform.
- Node 18+ and the platform SDKs (Xcode 15+ for iOS, Android Studio Hedgehog+ for Android).
- Mushi project already created — we keep the same
projectIdandapiKey.
API mapping (Cordova plugins → Capacitor)
Most popular Cordova plugins have a 1:1 Capacitor counterpart:
| Cordova plugin | Capacitor equivalent |
|---|---|
cordova-plugin-camera | @capacitor/camera |
cordova-plugin-geolocation | @capacitor/geolocation |
cordova-plugin-statusbar | @capacitor/status-bar |
cordova-plugin-splashscreen | @capacitor/splash-screen |
cordova-plugin-network-information | @capacitor/network |
cordova-plugin-device | @capacitor/device |
cordova-plugin-file | @capacitor/filesystem |
cordova-plugin-inappbrowser | @capacitor/browser |
cordova-plugin-clipboard | @capacitor/clipboard |
cordova-plugin-vibration | @capacitor/haptics |
cordova-plugin-share | @capacitor/share |
cordova-plugin-firebase-messaging | @capacitor/push-notifications + @capacitor-firebase/messaging |
cordova-sqlite-storage | @capacitor-community/sqlite |
| Mushi Cordova SDK (deprecated) | @mushi-mushi/capacitor |
For anything not listed, search the Capacitor Plugins catalog or the Capawesome community plugins .
Migration checklist
Migration checklist
11 required steps
- Step 01Create a migration branch
- Step 02Install Capacitor in the existing project
- Step 03Build your web bundle once before adding platforms
- Step 04Add native platforms
- Step 05Regenerate splash screens and icons
- Step 06Replace Cordova plugins with Capacitor equivalents
- Step 07Swap the Mushi Cordova SDK for @mushi-mushi/capacitor
- Step 08Audit native permissions (`Info.plist`, `AndroidManifest.xml`)
- Step 09Re-wire deep links and custom URL schemes
- Step 10Remove Cordova
- Step 11Smoke-test on a device, including a Mushi report
Common gotchas
- iOS scheme defaults changed. Capacitor uses
capacitor://by default; if your app stores anything under origin-bound web APIs (cookies, IndexedDB), setserver.iosScheme: "ionic"incapacitor.config.jsonto keepionic://and avoid wiping user data. - Splash hide timing. Capacitor’s
@capacitor/splash-screendoesn’t auto-hide — callSplashScreen.hide()once your app is mounted, or setlaunchAutoHide: truein config. whitelistplugin gone. Capacitor uses native ATS (iOS) andusesCleartextTraffic(Android) instead of Cordova’s whitelist. Add your Mushi endpoint and any other API hosts to those if you allow non-HTTPS.
Rollback
You branched in step 1, so:
git checkout main
# Native projects are gitignored if you followed Capacitor's recommendations,
# so deleting the migration branch leaves your Cordova app untouched.If you committed and pushed before discovering a regression, revert the merge commit; Cordova builds will start working again immediately.
Related guides
- Capacitor → React Native — once you’re on Capacitor, the next move (if you want it) is well-trodden.
@mushi-mushi/capacitorSDK reference- Capacitor → bottom-dock notes — keep the Mushi widget above your tab bar.
References
Last updated on