cap update

cap update: Keeping Native Dependencies Current

A Capacitor 243,123 plugin is an npm 2,036 package that carries its own Android library and iOS Swift package. npm install only puts it in node_modules; cap update reads package.json and regenerates the files that tell Gradle 19,597 about each plugin, and cap ls lists what it finds.

Installing a plugin and wiring it into GradleShell
npm install @capacitor/preferences
npx cap ls android
npx cap update android
Output
$ npx cap ls android
[info] Found 1 Capacitor plugin for android:
       @capacitor/preferences@8.0.1
$ npx cap update android
✔ Updating Android plugins in 3.57ms
...
✔ update android in 87.05ms
[info] Update finished in 0.092s

Afterward android/capacitor.settings.gradle includes a :capacitor-preferences module from ../node_modules/@capacitor/preferences/android, app/capacitor.build.gradle depends on it, and capacitor.plugins.json names its class for the bridge to register (Plugin Registry). Every update rewrites these files, so never edit them. Upgrading a plugin is an npm install plus cap sync; keep all @capacitor/* packages on one major version. On iOS (not run here), update refreshes the Swift package list, or runs pod install in a CocoaPods 66,002 project.