with one click
cordova-to-capacitor
// Complete guide for migrating from Apache Cordova to Capacitor. Use this skill when users need to modernize a Cordova/PhoneGap app to Capacitor, migrate plugins, or understand platform differences.
// Complete guide for migrating from Apache Cordova to Capacitor. Use this skill when users need to modernize a Cordova/PhoneGap app to Capacitor, migrate plugins, or understand platform differences.
Use for Capgo Cloud Build native iOS and Android workflows, including CLI login, API-key handling, iOS build onboarding, signing credential storage, build requests, store upload settings, output download links, and troubleshooting. Do not use for OTA bundle uploads or generic Capacitor setup unless a native Capgo build is requested.
Revenue playbook for getting a mobile or web subscription app from zero to early MRR. Use when users ask how to make revenue, reach $1K MRR, monetize an app, get first users, improve ASO, plan TikTok/Reels/Shorts or Reddit acquisition, design a paywall, choose freemium vs trial, price subscriptions, reduce churn, or build a simple growth loop for an app.
Guide to migrating an existing Capacitor iOS app from CocoaPods to Swift Package Manager (SPM). Use this skill when users want Capacitor 8-style SPM projects, need to run or recover from spm-migration-assistant, replace Podfile/Pods/App.xcworkspace with CapApp-SPM, add debug.xcconfig, verify plugin SPM support, or remove CocoaPods from an app project.
Guides the agent through migrating Capacitor apps from Ionic Enterprise SDK plugins to Capgo and Capacitor alternatives. Covers dependency detection, API replacement, local storage changes, and platform cleanup. Do not use for generic Capacitor version upgrades or Capgo live updates.
Guides the agent through migrating SQLite and SQL-style Capacitor plugins to @capgo/capacitor-fast-sql. Use when replacing bridge-based SQL plugins, adding encryption, preserving transactions, or moving key-value storage onto Fast SQL. Do not use for non-SQL storage, generic app upgrades, or plugins that already wrap Fast SQL.
Guide for migrating an existing web app, PWA, or SPA into a store-ready Capacitor iOS and Android app. Use this skill when users want to wrap or convert a web app into a mobile app, avoid thin WebView app store rejection, add native-feeling UX, handle permissions, offline behavior, account deletion, billing, testing, and Capgo live updates.
| name | cordova-to-capacitor |
| description | Complete guide for migrating from Apache Cordova to Capacitor. Use this skill when users need to modernize a Cordova/PhoneGap app to Capacitor, migrate plugins, or understand platform differences. |
| allowed-tools | ["Bash(node -e *)","Bash(find *)","Bash(cordova *)","Bash(npm *)","Bash(npx *)"] |
Step-by-step guide for migrating from Apache Cordova/PhoneGap to Capacitor.
Current migration-related packages:
!node -e "const fs=require('fs');if(!fs.existsSync('package.json'))process.exit(0);const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));const out=[];for(const section of ['dependencies','devDependencies']){for(const [name,version] of Object.entries(pkg[section]||{})){if(name.includes('cordova')||name.startsWith('@capacitor/')||name.startsWith('@ionic-enterprise/'))out.push(section+'.'+name+'='+version)}}console.log(out.sort().join('\n'))"
Relevant config and platform paths:
!find . -maxdepth 3 \( -name 'config.xml' -o -name 'capacitor.config.json' -o -name 'capacitor.config.ts' -o -name 'capacitor.config.js' -o -path './ios' -o -path './android' \)
| Aspect | Cordova | Capacitor |
|---|---|---|
| Native IDE | Builds via CLI | First-class Xcode/Android Studio |
| Plugin Management | Separate ecosystem | npm packages |
| Updates | Full app store review | Live updates with Capgo |
| Web App Platform | Any | Any (React, Vue, Angular, etc.) |
| Maintenance | Slowing down | Active development |
| TypeScript | Limited | Full support |
| Modern APIs | Older patterns | Modern Promise-based APIs |
Start from the injected snapshot above before falling back to manual inspection.
Check Cordova version:
cordova --version
cordova platform version
List installed plugins:
cordova plugin list
Review config.xml:
cat config.xml
In your existing Cordova project:
# Install Capacitor
npm install @capacitor/core @capacitor/cli
# Initialize Capacitor
npx cap init
When prompted:
com.company.app)www for Cordova projectsCapacitor doesn't modify web assets. Add platforms separately:
# Add iOS platform
npm install @capacitor/ios
npx cap add ios
# Add Android platform
npm install @capacitor/android
npx cap add android
This creates:
ios/ directory with Xcode projectandroid/ directory with Android Studio projectCRITICAL: Check plugin compatibility first.
| Cordova Plugin | Capacitor Equivalent | Install Command |
|---|---|---|
| cordova-plugin-camera | @capacitor/camera | npm install @capacitor/camera |
| cordova-plugin-geolocation | @capacitor/geolocation | npm install @capacitor/geolocation |
| cordova-plugin-device | @capacitor/device | npm install @capacitor/device |
| cordova-plugin-network-information | @capacitor/network | npm install @capacitor/network |
| cordova-plugin-statusbar | @capacitor/status-bar | npm install @capacitor/status-bar |
| cordova-plugin-splashscreen | @capacitor/splash-screen | npm install @capacitor/splash-screen |
| cordova-plugin-keyboard | @capacitor/keyboard | npm install @capacitor/keyboard |
| cordova-plugin-dialogs | @capacitor/dialog | npm install @capacitor/dialog |
| cordova-plugin-file | @capacitor/filesystem | npm install @capacitor/filesystem |
| cordova-plugin-inappbrowser | @capacitor/browser | npm install @capacitor/browser |
| cordova-plugin-media | @capacitor/media | Custom or use @capgo plugins |
| cordova-plugin-vibration | @capacitor/haptics | npm install @capacitor/haptics |
| cordova-plugin-local-notifications | @capacitor/local-notifications | npm install @capacitor/local-notifications |
| cordova-plugin-push | @capacitor/push-notifications | npm install @capacitor/push-notifications |
For biometrics:
# Cordova
cordova plugin add cordova-plugin-fingerprint-aio
# Capacitor
npm install @capgo/capacitor-native-biometric
For payments:
# Cordova
cordova plugin add cordova-plugin-purchase
# Capacitor
npm install @capgo/capacitor-purchases
For social login:
# Facebook
npm install @capgo/capacitor-social-login
# Google
npm install @codetrix-studio/capacitor-google-auth
Check the full plugin catalog: https://github.com/Cap-go/awesome-capacitor
Cordova (old):
document.addEventListener('deviceready', () => {
navigator.camera.getPicture(success, error, options);
});
Capacitor (new):
import { Camera } from '@capacitor/camera';
// No deviceready event needed
const image = await Camera.getPhoto({
quality: 90,
allowEditing: true,
resultType: CameraResultType.Uri
});
Device Information:
// Cordova
const uuid = device.uuid;
const platform = device.platform;
// Capacitor
import { Device } from '@capacitor/device';
const info = await Device.getId();
const platform = await Device.getInfo();
Network Status:
// Cordova
const networkState = navigator.connection.type;
// Capacitor
import { Network } from '@capacitor/network';
const status = await Network.getStatus();
console.log('Connected:', status.connected);
Geolocation:
// Cordova
navigator.geolocation.getCurrentPosition(success, error);
// Capacitor
import { Geolocation } from '@capacitor/geolocation';
const position = await Geolocation.getCurrentPosition();
Capacitor doesn't need deviceready. Plugins work immediately.
// Cordova (remove this)
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
// Your code
}
// Capacitor (just use directly)
import { Camera } from '@capacitor/camera';
async function takePicture() {
const photo = await Camera.getPhoto();
}
Cordova uses config.xml. Capacitor uses capacitor.config.ts
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.company.app', // From config.xml widget id
appName: 'My App', // From config.xml name
webDir: 'www', // From Cordova build output
server: {
androidScheme: 'https'
},
plugins: {
SplashScreen: {
launchShowDuration: 3000,
backgroundColor: '#ffffff',
androidScaleType: 'CENTER_CROP',
showSpinner: false
}
}
};
export default config;
Preferences:
<!-- Cordova config.xml -->
<preference name="Orientation" value="portrait" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
Capacitor equivalent:
@capacitor/status-bar pluginPlatform-specific config:
<!-- Cordova config.xml -->
<platform name="ios">
<allow-intent href="itms:*" />
</platform>
Capacitor equivalent:
// capacitor.config.ts
const config: CapacitorConfig = {
ios: {
contentInset: 'always',
},
android: {
allowMixedContent: true,
}
};
Capacitor requires explicit permission configuration.
Add to ios/App/App/Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need camera access to take photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need photo library access to select images</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need location to show nearby places</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need microphone access for audio recording</string>
Add to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Sync web code with native projects:
npx cap sync
This copies:
www/ to native projectsBuild for iOS:
npx cap open ios
# Then build in Xcode (Cmd+R)
Build for Android:
npx cap open android
# Then build in Android Studio (Run)
Test all plugin functionality:
Check for:
Once migration is complete and tested:
# Remove Cordova platforms
cordova platform remove ios
cordova platform remove android
# Remove Cordova
npm uninstall cordova
npm uninstall cordova-ios
npm uninstall cordova-android
# Remove Cordova plugins
cordova plugin list | xargs -I {} cordova plugin remove {}
# Remove config.xml (after backing up)
mv config.xml config.xml.backup
Problem:
Error: Plugin not found
Solution:
npm listnpx cap syncProblem: Cordova's deviceready event doesn't exist in Capacitor.
Solution:
Remove all deviceready event listeners. Capacitor plugins work immediately.
// Remove this
document.addEventListener('deviceready', onDeviceReady);
// Use this
import { App } from '@capacitor/app';
App.addListener('appStateChange', (state) => {
console.log('App state changed:', state.isActive);
});
Problem: App shows white screen or crashes.
Solution:
webDir in capacitor.config.ts points to correct build outputnpm run buildnpx cap syncProblem: Camera/location/etc. fail silently.
Solution:
import { Camera } from '@capacitor/camera';
// Capacitor handles permission prompts automatically
const photo = await Camera.getPhoto();
Problem: Some third-party Cordova plugins still reference Cordova global.
Solution: Use the Capacitor Cordova compatibility layer:
npm install cordova-plugin-example
npx cap sync
Capacitor includes Cordova compatibility, but:
You can run Cordova and Capacitor side-by-side during migration.
When ready, remove Cordova entirely.
cordova plugin listnpm install @capacitor/plugin-namedeviceready event listenersnpx cap syncCapacitor enables instant updates without app store review.
After migration, add Capgo for OTA updates:
# Install Capgo plugin
npm install @capgo/capacitor-updater
# Create account at capgo.app
npm install -g @capgo/cli
capgo login
# Initialize and deploy
capgo init
npm run build
capgo upload
Users get updates instantly. See the capgo-live-updates skill for details.
| App Size | Estimated Time |
|---|---|
| Small (1-3 plugins) | 2-4 hours |
| Medium (4-8 plugins) | 1-2 days |
| Large (9+ plugins) | 3-5 days |
| Enterprise (custom plugins) | 1-2 weeks |
After migrating from Cordova to Capacitor:
ā Faster development - Direct access to Xcode/Android Studio ā Live updates - Deploy updates without app store review (with Capgo) ā Better TypeScript - Full type safety ā Modern APIs - Promise-based, async/await ā Active maintenance - Regular updates and improvements ā Better debugging - Native IDE debugging tools ā Improved performance - Optimized native bridge
capacitor-ci-cd skill)capgo-live-updates skill)capacitor-app-store skill)