I am new to the capacitor and developing an application where I am making changes into code and running
And it is also recommended to use npx cap sync
in behalf of npx cap copy
.
What is the exactly difference between both.
where to use which one ? Please assist.
npx cap update searches for Cordova and Capacitor plugins and copy/update some native files the plugins need for working. So copy is for "web" files and update for "native" files and sync does both. Answered By - jcesarmobile.
ionic capacitor sync will do the following: Perform an Ionic build, which compiles web assets. Copy web assets to Capacitor native platform(s) Update Capacitor native platform(s) and dependencies.
npx cap copy
just copies whatever is in your webDir
to the native platforms (and some cordova files if you have cordova plugins installed).
npx cap sync
runs npx cap copy
and npx cap update
npx cap update
searches for Cordova and Capacitor plugins and copy/update some native files the plugins need for working.
So copy is for "web" files and update for "native" files and sync does both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With