capacitor-app-upgrade-v5-to-v6
Skill75 starsChanged 35 days agoMITView on GitHub
Upgrades a Capacitor app from v5 to v6 using `npx cap migrate` from `@capacitor/cli@latest-6`, then the manual checklist - Node 18+, Xcode 15+, Android Studio Hedgehog, AGP 8.2.1, Gradle 8.2.1, compile/target SDK 34, `compileSdkVersion` to `compileSdk`, the `androidScheme` default flipping to `https` (data loss risk), iOS local plugins no longer auto-registered, iOS zoom disabled by default, and official plugin breaking changes (`addListener` returns only a Promise, Camera Photo Picker, Filesystem ctime/mtime numbers). Use when `@capacitor/core` is 5.x and the target is 6.x, or after the upgrade users are logged out on Android, a custom iOS plugin is "not implemented", or `addListener(...).remove` no longer compiles. Do not use for other major versions, plugin library upgrades, or non-Capacitor apps.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Aver005/agent-skillsedited, first seen Feb 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- Aver005/agent-skills★ 232% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- capacitor-accessibilitySkill
- capacitor-app-intentsSkill
- capacitor-apple-review-preflightSkill
- capacitor-app-storeSkill
- capacitor-app-upgradesSkill
- capacitor-app-upgrade-v4-to-v5Skill
- capacitor-app-upgrade-v6-to-v7Skill
- capacitor-app-upgrade-v7-to-v8Skill
- capacitor-app-upgrade-v8-to-v9Skill
- capacitor-best-practicesSkill
- capacitor-ci-cdSkill
- capacitor-deep-linkingSkill
- capacitor-ios-resizabilitySkill
- capacitor-ios-security-hardeningSkill
- capacitor-keyboardSkill
- capacitor-mcpSkill
- capacitor-offline-firstSkill
- capacitor-performanceSkill
- capacitor-plugin-spm-supportSkill
- capacitor-pluginsSkill
- capacitor-plugin-upgradesSkill
- capacitor-plugin-upgrade-v4-to-v5Skill
- capacitor-plugin-upgrade-v5-to-v6Skill
- capacitor-plugin-upgrade-v6-to-v7Skill
- capacitor-plugin-upgrade-v7-to-v8Skill
- capacitor-plugin-upgrade-v8-to-v9Skill
- capacitor-push-notificationsSkill
- capacitor-securitySkill
- capacitor-splash-screenSkill
- capacitor-testingSkill
- capacitor-uiscene-migrationSkill
- capawesome-live-update-migrationSkill
- capgo-cli-usageSkill
- capgo-cloudSkill
- capgo-live-updatesSkill
- capgo-native-buildsSkill
- capgo-organization-managementSkill
- capgo-release-managementSkill
- capgo-release-workflowsSkill
- cocoapods-to-spmSkill
- cordova-to-capacitorSkill
- debugging-capacitorSkill
- framework-to-capacitorSkill
- ionic-appflow-migrationSkill
- ionic-designSkill
- ionic-enterprise-sdk-migrationSkill
- ios-android-logsSkill
- konsta-uiSkill
- safe-area-handlingSkill
- skill-creatorSkill
- sqlite-to-fast-sqlSkill
- subscription-app-revenueSkill
- tailwind-capacitorSkill
- webapp-to-capacitorSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
After upgrading: Android users lose localStorage/cookies, a local (non-npm) iOS plugin reports "<Name>" plugin is not implemented on ios, …
- Distinctive: line 31
Only load a reference when its topic is in play.
- Distinctive: line 62
Run the automated migration:
- Distinctive: line 69
Read the output and finish every step it reports as failed.
- Very specific: line 74
Update all @capacitor/* plugins to ^6.0.0 and community plugins to their Capacitor 6 releases.
- Very specific: line 82
Do not remove READ_MEDIA_IMAGES / storage permissions if saveToGallery: true or another plugin needs them.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Capacitor App Upgrade v5 to v6
Move a Capacitor 5 app to Capacitor 6. Source of truth: https://capacitorjs.com/docs/updating/6-0
When to Use
@capacitor/corein the snapshot below is5.xand the user wants6.x.- After upgrading: Android users lose localStorage/cookies, a local (non-npm) iOS plugin reports
"<Name>" plugin is not implemented on ios, pinch-zoom stopped working on iOS, or TypeScript errors aroundaddListener. - The user asks for the exact 5 -> 6 checklist.
Do not use:
- App on 4.x ->
capacitor-app-upgrade-v4-to-v5first. On 6.x ->capacitor-app-upgrade-v6-to-v7. Multi-hop planning ->capacitor-app-upgrades. - Plugin library upgrade ->
capacitor-plugin-upgrade-v5-to-v6. - Moving iOS from CocoaPods to SPM (experimental in 6) ->
cocoapods-to-spm.
Live Project Snapshot
Current Capacitor packages from package.json:
!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.startsWith('@capacitor/'))out.push(section+'.'+name+'='+version)}}console.log(out.sort().join('\n'))"
References
Only load a reference when its topic is in play.
| File | Load when |
references/android.md | Editing variables.gradle, build.gradle, wrapper, or Kotlin by hand |
references/plugins.md | The app uses official @capacitor/* plugins or stores addListener results |
Preflight
| Tool | Minimum for Capacitor 6 |
| Node.js | 18+ (latest LTS recommended) |
| Xcode | 15.0+ |
| Android Studio | Hedgehog 2023.1.1+ |
| Java (Gradle JDK) | 17 |
| AGP / Gradle | 8.2.1 / 8.2.1 |
| Android SDK | minSdk 22, compileSdk 34, targetSdk 34 |
| iOS deployment target | 13.0 (unchanged) |
node -v && xcodebuild -version && java -version
git status --short
grep -rn "androidScheme" capacitor.config.* # decide the scheme BEFORE migratingProcedure
- Confirm 5.x from the snapshot.
- Decide
androidSchemefirst (judgement call, ask the user if unclear). Capacitor 6 defaults existing apps tohttps. Changing scheme changes the WebView origin, so localStorage, IndexedDB, cookies and service workers from the installed app are no longer readable.- No
androidSchemeset today -> addserver: { androidScheme: "http" }to keep user data. - Already
"https"-> the entry can be removed.
- No
Run the automated migration:
npm i -D @capacitor/cli@latest-6 npx cap migrateRead the output and finish every step it reports as failed.
- iOS:
- Plugin classes are no longer auto-registered. npm plugins are handled by the CLI-generated list. Local plugins written in the app target (custom code guide) need a
CAPBridgeViewControllersubclass that overridescapacitorDidLoad()and callsbridge?.registerPluginInstance(MyPlugin()), andMain.storyboardmust use that subclass as the view controller's custom class. - Zoom is disabled by default. If the app relied on pinch zoom, set
zoomEnabled: truein the Capacitor config.
- Plugin classes are no longer auto-registered. npm plugins are handled by the CLI-generated list. Local plugins written in the app target (custom code guide) need a
- Android: apply
references/android.md(AGP 8.2.1, Gradle 8.2.1, google-services 4.4.0,compileSdk, Kotlin 1.9.10). - Update all
@capacitor/*plugins to^6.0.0and community plugins to their Capacitor 6 releases. Fix code perreferences/plugins.md. - Run verification.
Traps
addListenernow returns onlyPromise<PluginListenerHandle>.const h = Plugin.addListener(...); h.remove()no longer compiles; useconst h = await Plugin.addListener(...).- Camera now uses the Android Photo Picker. Gallery cancel rejects with
"User cancelled photos app"on Android, like other platforms; update error matching. - Filesystem
stat()on iOS returnsctime/mtimeas numbers, not strings. - Do not remove
READ_MEDIA_IMAGES/ storage permissions ifsaveToGallery: trueor another plugin needs them.
Verification
grep -rn "androidScheme" capacitor.config.* # explicit decision recorded
grep -n "compileSdkVersion rootProject" android/app/build.gradle # expect none (now compileSdk)
grep -n "gradle:8.2.1\|google-services:4.4.0" android/build.gradle
grep -n "distributionUrl" android/gradle/wrapper/gradle-wrapper.properties # gradle-8.2.1
grep -n "SdkVersion" android/variables.gradle # 22 / 34 / 34
grep -rnE "= *[A-Za-z]+\.addListener\(" src/ # each must be awaited
grep -rn "registerPluginInstance" ios/App/App/ # present if the app has local plugins
npx cap sync
cd android && ./gradlew assembleDebugBuild and launch iOS in Xcode 15+. On a device that had the v5 build installed, upgrade in place and confirm login/localStorage survived.
Error Handling
| Error | Fix |
Migrate can only be used on capacitor 5 and above, please use the CLI in Capacitor 5 to upgrade to 5 first | Run capacitor-app-upgrade-v4-to-v5 first. |
Capacitor 6 requires JDK 17 or higher. Some steps may fail. | Set Gradle JDK to 17+. |
Unable to find "<text>" in <file>. Try updating it manually | Apply the diff from references/android.md. |
"<Plugin>" plugin is not implemented on ios (local plugin) | Register it in a CAPBridgeViewController subclass (step 4). |
Property 'remove' does not exist on type 'Promise<PluginListenerHandle>' | await the addListener call. |
| Users logged out / data gone on Android | Scheme changed. Restore the previous androidScheme value. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

