"the connection to the server is unsuccessful" ionic run android -l -c

while i run the ionic app in android device using “ionic run android -l -c”, i got the alert

the connection to the server is unuccessful. (

Why this?

Lomas Joshi

Are you already running something on that IP and Port? e.g. ionic serve
Or, do you have firewall blocking you from running something on that IP and port?

Hi edd,
I am only running “ionic run android -l -c” and i am not enabled any firewall.
can i choose the ip address while running this command?
I got this this ip is the windows phone emulator ip.

Lomas Joshi

If that IP belongs to Windows Phone emulator, maybe try shutting that down first before trying to run on an Android device.

Also, can you run ionic run android ok, without the “-l” ?

Hello edd,
I found the cause(why this happening):
When i run the “ionic run android -l -c” command for first time, it shows me the message:

multiple address are available, Please select the one:

  1. Windows phone emulator
  2. wifi

Unfortunately i select option 1, so i am getting this error. And now i have no any option to choose.
so how can i change this to run at wifi.

Lomas Joshi

Not sure exactly how to bring back the choice.

I would suggest disabling the Windows Phone Emulator temporarily and trying again.
Shut down command prompt and start over
Good old restart of your machine.

If anyone knows a better way to bring back the multiple address choice, let us know!

Thanks edd,
Disabling windows phone emulator works for now.
But it would be great if there is a way to bring back the multiple address choice.

Lomas Joshi

I am pretty sure running ionic address will let you make a new choice. Hope that helps.


I noticed that the IP on the error was my computer’s IP address, so, I connected the device to the same network (wifi in my case) as the computer and works perfectly.


Reviving the old topic but i just had headaches with this… might help someone
So in my case I had to do:

ionic address
select for instance option 2 which was wi-fi

then on
ionic run android -lc

I had to match that address.

So it doesn’t matter what you choose - just match the address and -lc and i think that does it.


Same headaches… but launching “ionic address” doesn’t allow me to chose anything; the command seems just ignored, actually.

Any idea?

Well, you’re either

  • Making a typo with a command (unless you’re copying it from here)
  • Not inside of an Ionic project folder
  • Not having properly installed ionic

if its not first 2, try to uninstall and install back cordova & ionic

Apart from that, everything works. So, I would like to ask: is there a risk to uninstall/reinstall Ionic?

My system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.7.3
Xcode version: Not installed

I did it a few times and there was no errors or anything so as far as I can tell its all safe.

1 Like

I unisntalled/reinstalled ionic, without any change (launching “ionic address” in the project’s folder gives no result).

Any idea?..

Can’t help you much like this but obviously you are doing something wrong, i.e. that’s not a normal behavior to not have a ionic address command in cli … you’re missing out on something somewhere… try from a fresh starter project… don’t know, cant say much this way, try to open a new topic and post your logs or whatever and hopefully you fix it

You need to connect same WIFI network to which your laptop is connected.
connect your phone to the same network. that works for me. (y)