Can't access localhost. Ionic Serve, Run and Build commands are broken


Wherever I try to perform any of these commands, I get error messages:

  • ionic serve >>> Browser (Firefox or Chrome) do not connect do localhost. It only works if a set another IP using “ionic address” -> choose IP diferent from localhost -> “ionic serve”.

  • ionic run android >>> “Error executing “adb devices”: error: could not install smartsocket listener: cannot bind to” and other things (see below)

  • ionic build android >>> “ Unable to establish loopback connection” and other things (see below)


  1. I have been using Ionic for 15 days, running those commands succesfully several times.
  2. These errors started to occurr after I manully close the command prompt and the Android Emulator windows in the middle of an “ionic emulate” operation (such a small thing could cause these problems?).

—System Status----
Ionic 1.7.13
Node 5.5.0
Cordova 6.0.0
NPM 3.3.12
Java JDK 1.7.0_45 and 1.8.0_71
Android SDK - Almost all packages (see:
Windows 8.1

Antivirus: Kaspersky -> disabled
Windows firewall -> disabled

----System variables----
JAVA_HOME C:\Program Files\Java\jdk1.8.0_71
ANDROID_HOME C:\Users\EscolhaFacil\AppData\Local\Android\android-sdk
PATH C:\Users\EscolhaFacil\AppData\Local\Android\android-sdk\platform-tools;C:\Users\EscolhaFacil\AppData\Local\Android\android-sdk\tools;C:\Users\EscolhaFacil\AppData\Roaming\npm and dozens of other things

—Solutions that I tried, but didn’t solved the problem----

  1. adb kill-server then adb start-server
  2. adb -P 5038 start-server (start ADB server on onther port, default is :5037)
  3. adb -H start-server (start ADB server on the same IP that I get “ionic serve” to work)
  4. manually kill “adb.exe” on task manager

-----Complete ERROR LOGs---------

-----Complete nestat report---------
After 'adb start-server’
After ‘ionic serve’ for localhost (that didn’t opened on the browser)

*PID 4552 - adb.exe
*PID 5340 - node.js


In a command prompt try to ping localhost. If that fails it could be your hosts file or DNS is clobbered. Ipconfig /flushdns. Try to ping localhost again. If still bad check your windows/system32/drivers/etc/hosts file.



  1. ping -> OK, TTL 128
  2. Ipconfig/flushdns - OK
  3. Hosts file - I believe that localhost access is handle by DNS, but anyway I add the line “ localhost” to sytem32/hosts

The problem is still there.

I also tried:

------Something weird----------

  1. Task Manager -> Kill “adb.exe”
  2. Command prompt -> ionic run android
  3. Task manager shows that two new “adb.exe” are created:
  4. Ionic trows error “could not install smartsocket listener”

Considering that is only possible to have one proccess running (listening) in port, why the “ionic run” command tries to initiate two instances of adb.exe?


The best thread I could find about this is at but you seem to be having a very slightly different issue. Ptrobably still worth going through that thread and checking it out.

I use kaspersky as you do but even with it enabled I have no issues.


I am having the same issue, everything was working until I updated my project to Cordova 6.3.1 and Ionic 2.0.0.

Using Genymotion as a Virtual Device (both run and emulate fail)

Update: Works if I run it on a physical Android Device.

Update 2: It was an Issue with Genimotion, please see this link for solution:


Hi did you find a solution? What was it?