Live Reload does not work anymore since the upgrade to Capacitor 7

Hello,

I updated my app’s packages, and since then, when I try to run it on a real device with ionic cap run android --prod --open -l --external it launches correctly, but the changes aren’t detected (or the device doesn’t reload as expected).

When I try to open it in a browser, it works as expected: the changes are detected and the page reloads.

In fact, it seems that the live reload mode isn’t working when I compile on a real device, whereas it used to work.

Is anyone else experiencing the same problem? Perhaps you’ve found a solution?

Thanks for your help,
Loïc

Also, even when I add the --prod flag, it seems to use the dev environment when I add the -l flag.
This wasn’t the case before.

Hello @twestrick,
Do you have any idea about this behavior :confused: ?

The live reload works correctly on browser (even on the browser of the simulator with the external url) but doesn’t work with the builded app.

I am not really sure. What framework are you using and what build tool (e.g. Vite, Angular CLI)?

If I remember correctly, the last time I tried using the --prod flag, it didn’t work. That was at least a year ago.

Hello,
Here are my configs:

Ionic:

   Ionic CLI                     : 7.2.1 (/Users/me/.nvm/versions/node/v22.14.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 8.5.0
   @angular-devkit/build-angular : 17.3.13
   @angular-devkit/schematics    : 17.3.8
   @angular/cli                  : 17.3.13
   @ionic/angular-toolkit        : 11.0.1

Capacitor:

   Capacitor CLI      : 7.1.0
   @capacitor/android : 7.1.0
   @capacitor/core    : 7.1.0
   @capacitor/ios     : 7.1.0

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   Android SDK Tools : 26.1.1 (/Users/me/Library/Android/sdk)
   NodeJS            : v22.14.0 (/Users/me/.nvm/versions/node/v22.14.0/bin/node)
   npm               : 10.9.2
   OS                : macOS Unknown
   Xcode             : Xcode 16.2 Build version 16C5032a

I used the flag --prod last month without any issue but since the new updates, it does not work correctly.
(I mainly use the production environment, but sometimes I use staging to implement new features or to debug. This is why I use it).

I’m trying to debug but I’m also asking here if anyone has any idea that can help me identify and fix this issue :slight_smile:

Oh ok, I found something (after many tests) …

I used a capacitor.config.ts file in which I had all the settings (including the server settings).
When I launched the live reload on external mode, the configs for the server was added in a new and empty capacitor.config.json that take the lead for this feature.

So I have deleted the typescript version and I use now the json file.

After that it worked properly again :slight_smile:

This is strange because, I have switch to typescript version previous following the advice of ionic/capacitor.