Skip to main content
Back to plugins
@capgo/capacitor-patch
Tutorial
by github.com/Cap-go

Capacitor Patch

Apply version-gated Capacitor core, CLI, plugin, and native project patches during cap sync and update

Guide

Tutorial on Capacitor Patch

Using @capgo/capacitor-patch

Apply selected Capacitor fixes from a version-gated patch catalog during cap sync and cap update.

Install

npm install @capgo/capacitor-patch
npx cap sync

List available patches

npx capgo-capacitor-patch list --all

The catalog includes patch IDs, target packages, supported Capacitor versions, and links back to upstream Capacitor PRs.

Select patches in Capacitor config

import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'com.example.app',
  appName: 'Example',
  webDir: 'dist',
  plugins: {
    CapacitorPatch: {
      patches: ['upstream-pr-8418-android'],
      strict: true,
    },
  },
};

export default config;

Dry-run and sync

npx capgo-capacitor-patch doctor --phase package --strict
npx cap sync

Package patches run before sync and update. Native project patches run after sync and update.

Configuration

  • patches - explicit patch IDs to apply.
  • recommended - apply patches Capgo marks as recommended.
  • disabled - skip a selected patch ID.
  • strict - fail when a selected patch is incompatible or cannot apply.

Full Reference