Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between ionic cap sync and npx cap sync?

I used to build Ionic application and I'm used to ionic cap sync when I make changes in my code. Recently, I used npx cap sync instead and it is a lot faster but sometimes it feels like it just ignore all the changes I've made. When should I use one or the other?

like image 324
Michaël Randria Avatar asked Oct 12 '25 04:10

Michaël Randria


1 Answers

ionic cap sync first builds (ie ionic build) before doing the same as npx cap sync

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
  • Install any discovered Capacitor or Cordova plugins

Source: https://ionicframework.com/docs/cli/commands/capacitor-sync

Capacitor CLI - cap sync
This command runs copy and then update.

Source: https://capacitorjs.com/docs/cli/sync

like image 124
maxfloden Avatar answered Oct 16 '25 10:10

maxfloden