Closed MirazMac closed 2 weeks ago
You are using ionic command to run the app, when using ionic command to run the app, the Capacitor livereload code is not used.
You should be able to use https with ionic command by adding --ssl
option.
androidScheme
is not used for the live reload url, just for the url used for loading local assets.
Capacitor Version
Other API Details
Platforms Affected
Current Behavior
Despite setting an HTTPS URL in
capacitor.config.ts
, whenionic capacitor run android --livereload --external
is run, the app loads the HTTP version of the URL.Upon inspecting the generated android\app\src\main\assets\capacitor.config.json file, it also shows that is it has removed the HTTPS from the URL and is using the HTTP instead.
However, once the dev server exits this file changes the URL to https:// again.
It seems http is being hardcoded here: https://github.com/ionic-team/capacitor/blob/e4b05405a1319ca29fa328c584bba63bf5d281bb/cli/src/util/livereload.ts#L164
Expected Behavior
Ionic should use the server URL set in the config AS-IS. Stripping the protocol and using http by default defeats the purpose of setting an custom server URL entirely.
Project Reproduction
https://github.com/ionic-team/starters
Additional Information
My dev server is properly configured to use SSL, I generated the certificates and keys and added everything to the trust root and the live-server URL is accessible without any warnings in my phone via Chrome.