Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quasar changes capacitor.config.json on dev server start

Running Quasar dev server in Capacitor mode withquasar dev -m capacitor -T android results in the dialog to choose external IP address:

? What external IP should Quasar use? 192.168.0.3
 App • Updated src-capacitor/package.json
 App • Updated capacitor.config.json
 App • Running "...\node_modules\@capacitor\cli\bin\capacitor sync android" in ...

The problem is that this updates src-capacitor/capacitor.config.json with local information that can be accidentally pushed, which is never desirable:

  "server": {
    "androidScheme": "https",
    "url": "http://192.168.0.3:9500" <-- this line is added
  }

Not to mention that most times it would be practical to skip this dialog, as the application runs locally and can safely use localhost instead of external IP.

As loosely described in the documentation, this seems to be the expected behaviour but not desirable one.

How can updating server.url in capacitor.config.json be avoided?

like image 820
Estus Flask Avatar asked Sep 06 '25 08:09

Estus Flask


1 Answers

quasar dev -m capacitor -T android starts a web server and makes capacitor use that web server url for live reload. That’s what the dev option is for, so you can’t change that behavior. If you want to run your app without the live reload server you can use quasar build -m capacitor -T android instead, that will remove the server url from the capacitor.config.json.

like image 159
jcesarmobile Avatar answered Sep 09 '25 04:09

jcesarmobile