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?
Asked
Active
Viewed 2,139 times
4

Michaël Randria
- 453
- 1
- 5
- 21
2 Answers
2
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.

maxfloden
- 178
- 1
- 10
2
npx cap sync, copies only web assets in "web" folder to the native folder.
ionic cap sync, build and copies everything (dependencies, assets) the app requires to the native folder.

mani kandan
- 399
- 2
- 6