Dynamically disabling live updates in development mode

It seems like the only way to turn off live updates is by manually editing the capacitor.config.ts file. 100% of the time I either forget to do this or accidentally commit the change, or both. Is there really no way to have this automatically disabled in development mode?

If you are using the original, Cordova-based plugin, there is an option:

Generally speaking, if you are developing using an emulator and live reload you probably do not want Deploy to be active, as it can interfere with your local development.

We recommend setting the DisableDeploy preference to true in the config.xml file during local development. You can then set it back to false before building your binary for release by either manually setting it back or using the native config feature if you’re building native binaries.

Our new Capacitor-based version doesn’t have this yet, but we are going to be making some improvements soon to bring it closer in parity to the Cordova one, and that may include this request. We are evaluating lots of ideas right now. Thanks for the feedback, it’s always appreciated and helpful!

Thanks, this is really helpful. I’m not sure I understand what version I’m using… my package includes cordova-plugin-ionic, I’m setting cordova: { preferences: { DisableDeploy: 'true' } } in capacitor.config.ts (which successfully disables it), and I don’t have a config.xml file in my repo.

I wonder if what you’re saying is that I can permanently leave this set to true in capacitor.config.ts and then use a Native Config in Appflow that turns it back on for builds and it will override the setting in the code. If that’s the case then it solves my problem, but I feel like I’m missing something.

Yes, that’s the Cordova one.

I can permanently leave this set to true in capacitor.config.ts and then use a Native Config in Appflow that turns it back on for builds and it will override the setting in the code.

Yes, exactly.