Ionic capacitor live reload not working on android

I am using the following command to perform live reloading on android

ionic capacitor run android --livereload --external

But it is not working.

Here is the error I am getting

The web page at http://localhost:8100/ could not be loaded because

net : ERR_CONNECTION_REFUSED

I know that mobile devices don’t understand localhost but I thought --external flag will take care of it. Now what I have to do to get live reloading working on android.

Thank you in advance

1 Like

what are your ionic cli and capacitor/android capacitor/cli versions? try updating to latest

It is working with following command

Ionic capacitor run android -l --address=192.168.2.2
Where 192.168.2.2 is ip address

2 Likes

Also, make sure you’re not connected to a hotspot that isn’t connected to your PC / Mac’s network, obviously the local address won’t connect then… I legit did this once and was head-scratching for a while. :blush: