Jacek Rajba
Jacek Rajba

Reputation: 41

Ionic4 capacitor android livereload?

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.

Upvotes: 3

Views: 3190

Answers (3)

jcesarmobile
jcesarmobile

Reputation: 53301

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"
}

Upvotes: 4

elenche
elenche

Reputation: 181

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).

Upvotes: 1

Eric Ferreira
Eric Ferreira

Reputation: 1950

You can use the ionic cli for this:

ionic capacitor run android --livereload

For example.

Source: https://ionicframework.com/docs/cli/commands/capacitor-run

Upvotes: 0

Related Questions