Ionic4 capacitor android livereload?

Viewed 2794

Is there posibility to run ionic4 app with capacitor on android device with livereload? I was looking for answear for a few hours now without a luck. Please help.

3 Answers

If using a recent version of @ionic/cli, there is a command now ionic capacitor run android --livereload --external

You can do it manually too (if not using ionic CLI or using an old version that doesn't have the mentioned command) by adding the server object to the capacitor.config.json file, just use the url of your live reload server

"server": {
    "url": "http://192.168.1.33:8100"
}

You can use the following command to livereload without specifying the IP address:

ionic capacitor run android --livereload --external

The "--external" flag hosts the development server on all network interfaces (like adding --address=0.0.0.0) [1]. The "--livereload" flag can be shortened to "-l".

After executing the command, open your native IDE and run the app on the device or simulator. You will know that the livereload server is running when you see the message "Using app server http://x.x.x.x:8100" (your IP address).

Related