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

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