Can't bind to local 86XX for debugger - android

For some reason eclipse DDMS always gives the error 'Can't bind to local 86XX for debugger' every time I try and debug my app. This just started today for some reason.
I have looked at many posts and tried what they have suggested such as:
1. Adding 127.0.0.1 localhost to the hosts file and moving ::1
2. stopping and restarting adb
3. Under Window -> Preferences -> Android -> DDMS:
Set Base local debugger port to "8601"
Checked the box that says "Use ADBHOST" and set the value to "127.0.0.1"
I have also restarted the computer, updated Android platform tools and the eclipse plugin, Downloaded the latest adt-bundle and started the eclipse that is bundled with that.
I have ran netstat -anob and only javaw and adb use ports 8600+.
Does anyone have any ideas what I can try now?

If you are using Linux, I recommend you as well to run this command:
fuser -k 8600/tcp
With this command you will kill any process running at the 8600 TCP port (The one Android is using to debug).

I had same problem and none of given solutions worked. Then I have uninstalled all JRE 7 and installed latest JRE 6 (http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html). It have immediately fixed the problem.

I have the same problem. I tried really everything, all hints from the web.
I tried:
different versions of JRE and JDE
different ports
different mobiles
modified hosts file
changed preferences ddms
disabled the firewall completely
disabled all IPV6 functionality
I restarted the adb every time
I use Windows 8
Under many many tried it worked for two times. After exiting the debug session and starting another without any changed, the same shit started again....
BUT: I copied the whole environment path with eclipse and android sdk to antoher windows 8 machine, where it works without any problem!

One of the reasons for getting this error could be that there is an existing DDMS session open which is using the port. This is what happened with me. I had Device Manager open when I got this error. After closing the Device manager, I did a clean build and then it worked ! Guess DDMS and debugger are trying to use the same port which results in the problem.

If you are using Windows, then kill any process running at the port 8600 using the two following commands:
netstat -a -n -o | findstr :8600
It should give something like
TCP 127.0.0.1:8600 0.0.0.0:0 LISTENING 7508
Then run
taskkill /F /PID 7508 :: replace 7508 with the displayed PID

I solved this problem like this:
open powershell (Available in all windows after XP). Its a command Prompt. Give the command
> netstat -nao
It will list all the TCP and UDP port that are active on the computer. Find the entry whose local address contain some IP address : 8600. This is the TCP port that you wish to close.
Note the PID of this entry. In the powershell, give another command
> Stop-Process -Id PID
Here the PID is the one we have noted. Now start the debug from eclipse, it should bind the 8600 port with no further problems.

Related

android AVD connection refused on every other launch

Every other time I launch my app in an AVD I get this happy little error popping up:
Error running app:
Unable to open debugger port (localhost:8611): java.net.ConnectionException "Connection refused"
(would have posted a screenshot, but my reputation does not allow it)
It doesn't break anything, and after a couple relaunches it's back on track, but it's starting to annoy me. Does anyone know how to fix this? And I'm looking for a permanent fix, not a fix that would require me to do ten things over and over again every time this happens
Android Studio version 1.5.1 on Debian 8.2 using Oracle's java 1.8.0_66.
Also, to clarify, this is not an issue with my code. I can launch a completely empty project and still get this error popping up to say hi.
Running adb start-server in a standalone terminal yields the following:
cytodev#GE72-2QE:~$ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This uses a different port than the debugger port Android Studio uses, but I'm guessing that is normal.
There is an issue around IP v6 and how localhost is handled.
To fix the problem you will need to modify host file - see instruction.
(I don't deal much with Linux but I think it's similar configuration for both Windows and Linux)
Windows (Must open with administrator permission)
locate host file - C:\Windows\System32\Drivers\etc\hosts
uncomment (remove #) the following line:
# ::1 localhost
Linux (Must open with root)
locate host file - /etc/hosts
either add or uncomment ::1 localhost to the configuration file

DDMS - Can't bind to local 8600 for debugger on Android Studio

Am trying to view my database tables using Android Device Monitor and It showing me Errors for reasons which i am not really sure of. And i don't have another instance of DDMS running.
Instead of showing my DDMS, Its showing me this errors
[2015-09-10 17:39:53 - ddms] Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.
[2015-09-10 17:39:53 - ddms] Can't bind to local 8600 for debugger
[2015-09-10 17:39:53 - ddmlib] Broken pipe
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.java:677)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:523)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:847)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:775)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:664)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
Please, any one knows a solution to this ???
Try killing the adb server and restarting the adb server from terminal.
adb kill-server
adb start-server
Also on your mobile device, toggle the usb debugging.
Both of these combine worked for me when I had this issue.
Also you may want to consider using Stetho by Facebook, you can view your database as well as run queries with Stetho. Stetho also lets you watch network calls, view your view hierarchy and more.
On Mac, Open terminal and type:
sudo nano /etc/hosts
Add following line to your hosts file
127.0.0.1 localhost
Save and exit.
In Android Studio, you can start debugging again. I got stuck with the same problem and I ended up doing above, problem solved.
Hope this helps :) .
For osx users
Yes you need to restart adb. Simply restart android studio should do the trick. If it's still not working, force killing the thread on port 8600 by this
[sudo] lsof -i :8600
Then for the PID
kill -9 <PID>
A similar question helped me solve this issue here:
Android Studio and android device monitor
By opening DDMS from within Android Studio, I am able to bind and monitor my android devices with no more broken pipes or port conflicts.
Simply follow these steps to open DDMS from within android studio:
Select Tools > Android > Android Device Monitor
I can only assume AS runs a DDMS instance silently, since when AS is closed, manually opening DDMS has no issues. Only when AS is running do I get this when running DDMS from the CLI
What worked for me was restarting the computer. I think this happened after force-quitting Android Studio.
in case of converting your webapp into android app.
if u give your url like this : localhost:xxxx/abc/xx
then it create the problem because the port of your localhost and port of your emulator is different. you are using emulator it work like a separate device in your computer.
SO FRIENDS USE IP ADDRESS INSTEAD OF LOCALHOST AND IT WILL WORK ...101% WORK I AM SURE

ddms: 'adb.exe,start-server' failed -- run manually if necessary, Android Studio

My adb is down, no matter I am using ADT or Android Studio.
And according to the second answer of this SO question, I did:
I type:
adb nodaemon server
Output:
cannot bind 'tcp:5037'
Then netstat -ano | findstr 5037
I did find a pid of 7416 who listen in 127.0.0.1:5037
I use taskkill /pid 7416 -f to kill it.
I type netstat -ano | findstr 5037 again, I found another pid listens at 127.0.0.1:5037 again!
I guess they are the same, but I have no idea who it is.
Can I simply have a easy way to release this port or change the adb port to another one?
In my case I was trying to use genymotion emulator device.
With genymotion opened and running, I've tried to run my app in this emulator but I it doesn't worth
In this part I had this error:
'C:\Users\Jose\AppData\Local\Android\sdk\platform-tools\adb.exe,start-server' failed -- run manually if necessary
Then I've tried Jaskey's solution but it doesn't works.
So I stopped genymotion emulator.
Then I restart ADB (Tools > Android > Unchecked Unable ADB Integration then I've checked again)
Next I've start genymotion emulator again
And now the app works on the emulator.
For Windows,
Close Android Studio and any of your Emulators you are using,
then goto->TaskManager and Kill the process(adb.exe)
After finishing all these First open Android studio followed by emulators.
Sometimes there are conflicts between ADB Genymotion and ADB SDK because both of them use the same port. So I recommend always set up ADB Genymotion to use the ADB SDK, in that way to avoid incompatible issues.
Genymotion-> Settings -> ADB -> Use custom Android SDK tools (here your set up your sdk android location).
I solve this problem at last! I finally found the program name of the pid and I kill it in the task manager.
The way to detect is described in the question:
adb nodaemon server
Output:
cannot bind 'tcp:5037'
2.and then netstat -ano | findstr 5037 to find who takes this port.
Get the pid and find it in the task manager. Please note that the process tab may not show the column of pid, we should include it by setting.
In my case, it is tfadb.exe who takes this port! This is a Chinese Video program client! Try to kill it in task manager.
Now I stop it starting from booting. The problem is solved.
The best and working solution is:
Close Android Studio
Open task manager
Kill the process adb.exe
Open android studio again
Problem solved
Close Android studio then go to Task Manager
End Task adb.exe
goto Details menu
End Task java.exe and jusched.exe
now open Android Studio it will work properly
I solved by End task "adb.exe" background process from task manager.
and Start adb thats it :)
Open the Genymotion emulator after opening The Android studio.
in my case one application on window use adb.exe.
that application name is mobogenie.
Fixed ::
Goto Window TaskManager select adb.exe and press End process
Just goto the task manager on your PC, and kill adb.exe, then back to your android studio. it should initialize and reconnect.
disconnect any usb connected android devices. I was tethering to my laptop via my cellphone for internet connection. I got the adb start server failed error with loopback error "port is only used for one socket connection".
I disconnected my cellphone usb connection from my laptop and now android studio recognizes my genymotion emulator and another android device I have connected via usb in the deployment target box.
if genymotion or emulator not working try to install pdanet+ in your system and mobile device choose your mobile type(motorola,sony,other)it will automatically install driver and run your application in mobile device.
Check the firewall of the system. May be the "allow app to communicate through windows firewall" may have blocked android studio.
I have tried all of the solutions proposed above, but no one of them solve my problem. I had some hour of hadaches trying to solve this problem on my laptop (Ubuntu 20.04). This is how I came to solve it finally.
The problem was that the adb default port 5037 was already taken by another, so the solution became simple :
kill the process running on that port (5037) then launch the adb manually
launch the adb on another port :
user~$ adb start-server -P xxxx
Where xxxx represent another port
There may be a problem with Windows 11. to solve that issue follow the steps
Go to the android studio app
Right-click the app
Go to Properties
Go to compatibility
Check the Run this program in compatibility mode
Select windows version 10 or 8 or 7 Then apply and ok
After these changes start the Android Studio App, This is works for me.

ADB not responding. You can wait more, or kill "adb.exe" ... windows 8

When I try to test my Android application with an android emulator as always I now suddenly get an error message. I'm working with Windows 8. So far I tried the following things which unfortunately could not solve the problem:
reinstalling eclipse with android adt
reinstalling java
installing "android studios" first solved the problem but after one day mysteriously also here adb, stopped working with the error message given in the title " ADB not responding ...
furthermore I unsuccessfully tried out some advice from Mr. Google:
Stopping adb.exe via task-manager and restarting eclipse / android studios
"adb kill-server" then "start-server" via command prompt
setting the path to adb.exe as an environment variable
switching off any antivirus or firewall
starting the IDEs as an administrator
updating the IDEs
The only thing I can remember doing which may have destroyed adb on my computer for all times: I connected my motorola smartphone to my laptop and installed the motorola usb drivers but as I said the adb also won't work with the emulator.
Any help would be kindly appreciated. The issue bothers me for more than an entire day now. Maybe someone had similar problems on Windows 8 ?
On OSX helped:
Close Android Studio
Kill all processess using 5037 port
sudo lsof -i |grep 5037
sudo kill PID_NUMBER
Run adb devices from console
adb devices
Meanwhile the emulator is working again. I cannot definetly say what solved the problem. What It could be a combination of two things:
Deleting the hidden ".android" folder under C:\Users...
(Probably there was some malfunctioning automatically created code)
Deleting and recreating the Path variable to the folder with adb.exe ( ...\sdk\platform-tools\;)
Finally it could be a Windows 8 issue which I don't understand.
Try this,
Open a command prompt with administration permission and type
netsh interface tcp set global autotuninglevel=disabled
This worked for me
Edit: Windows only
Kill the adb.exe with a command prompt. Open a command prompt were your adb.exe is located and type
adb kill-server
Maybe HTTP Proxy blocked the localhost 127.0.0.1:5037
If you have config the HTTP Proxy, make sure to exclude the localhost like picture below
Also, port can also be blocked by the firewall and anti-virus firewall, please notice as well.
Try this,
at the prompt try adb kill-server
Start one of your AVDs
at the prompt try adb root
The prompt should say adbd is already running as root.
That should fix it.
In case it helps anyone else, for me the problem was related with the USB hub that the tablet was plugged into on the computer (unplugging the webcam which was in use fixed it).
I got the same error. Don't worry. I have an solution. Go to Task Manager. Kill the process called adb.exe. You will find 2 or 3 processes. Kill all of them. You are done. It will work.
I have the same problems. Verify port 5037 is free and ports 5555 to 5585 are available and never used by another process.
"ADB server sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585"
FROM: http://developer.android.com/tools/help/adb.html
To find out which process is listening on a port on Windows yo can use:
C:> netstat -an -o
FROM: How can you find out which process is listening on a port on Windows?
I had the same problem, here is my simple fix:
-Go to task manager in windows, look for adb.exe, and kill it
-Go to command prompt, and tap adb devices ==> it will automaticaly start adb daemon
I finally just restarted the computer, and that solved the issue for me.
Uninstall HTC Sync. Or disable it somehow.
Try to open adb from command prompt from directory location as <sdk>\platform-tools,
If adb file is missing try to re-install Android SDK with latest version,
And try to run again..
I think issues will solved, by this procedure.
I saw this on a Mac OS X.
I shut down Android Studio and ran adb get-state in the terminal. When I started Android Studio back up, the warning had gone away.
BTW, I did just try restarting Android Studio without any luck. I am sure a restart of OS would have fixed it too.
The same thing with the Asus Sync utility (with the both our Transformer's 700 and 701).
I think there is a USB-port conflict between ABD driver and Sync utility.
Exit from Sync utility resolve the problem.
Looks like this could be caused by a bunch of different issues. This just happened to me because I had my android phone device plugged in for USB debugging, then after a few hours (and multiple android studio/phpstorm restarts) I had to do unplug the device manually. Things started working again after unplugging.
I have faced this problem few days ago. When I opened my task manager it showing me two adb runnig. It may be because of I am using mobogenie for connecting my android phone for debugging application. This problem is because of moboginie and adt port conflict. then I have followed following procedure to sort out this issue.
!) close eclipse
2) Go to task manager and kill all adb processes.
3) Now go to platform-tools in android sdk
4)press shift+right click mouse and select "open command window here" option
5) type
adb kill-server
adb start-server
6)if server sucessfully started then start eclipse and then connect your phone
(Remember dont connect your phone before starting eclipse)
Following works for me every time:
go to File->Invalidate Caches/Restart
select Invalidate and Restart
And, You are good to go.

Eclipse error "ADB server didn't ACK, failed to start daemon"

After updating the SDK, Eclipse shows this error:
ADB server didn't ACK, failed to start daemon.
When I run an Android application, it gives me the following:
Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-tools\adb.exe' and can be executed.
How can I fix this problem?
Thanks, #jowett, I have solved my same problem, doing these steps
Step 1:
CTRL+Shift+Esc to open the task manager, which has adb.exe process and end (kill) that process
Step 2:
Now, close the eclipse, which is currently running on my computer.
Step 3:
Again, restart eclipse then solved that problem.
For those using OS X
killall adb
For those using Windows
adb kill-server
should do the trick.
I met same problem, though I didn't what caused this. Whatever, i find some clues and fixed finally.
When I open SDK and AVD manager, but find the AVD version(2.3.3) is not same with android lib version(2.3). So I create a new AVD with 2.3.
I fixed it by the following steps:
1. Open windows task manager and kill adb.exe process.
2. Close eclipse and restart it. Then it works.
Hope it helps.
Command prompt (cmd.exe):
netstat -aon | findstr 5037
Find the process id of 0.0.0.0:
Make sure it's adb.exe:
tasklist | findstr 1980
Kill this process:
taskkill /f /t /im adb.exe
Get ADB back to normal:
Credit: blog post *Android ADB server didn't ACK failed to start daemon*
These symptoms occur if you are using the Genymotion emulator (on Windows or Linux) at the same time as Android Studio:
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
Genymotion includes its own copy of adb, which interferes with the one bundled in the Android SDK.
The easiest way to fix seems to be to update your Genymotion Settings so it uses the same ADB as your Android SDK:
Just check the "Use custom Android SDK tools" option and enter your desired location.
ADB will often fail if there is a newline in adb_usb.ini. Remove it, restart it, and that will often solve the problem (at least for me anyway).
If you are using a sync application for the device, it could also be because there are other apps using the same 5037 port. Shut down all services running on port 5037 and try starting ADB.
To check if any application is using port 5037, use this:
netstat -a -n -o |findstr "5037"
Get the PID of the application.
Use Process Explorer to find the Process and exit it.
Now use adb start-server or adb get-state to start/check the ADB server status.
I faced the issue when I used the Snappea / Wandoujia Sync application.
I caused this problem by entering an extra blank line at the end of ~/.android/adb_usb.ini
(Removing the extra blank line fixed the problem)
We can solve this issue so easily.
Open a command prompt, and do cd <platform-tools directory>
Run command adb kill-server
Open Windows Task manager and check whether adb is still running. If it is, just kill adb.exe
Run command adb start-server in the command prompt
I have solved my first question: Open Eclipse, open the SDK Manager, and choose the device to open.
Or you can open the SDK directory. Open the SDK Manager, and then choose the device to open
2: Close Eclipse, and then open it.
Make sure USB debugging on your phone is turned on. ADB kill-server and ADB start-server is not the problem.
C:\Documents and Settings\Administrator> adb nodaemon server
- cannot bind 'tcp:5037'
C:\Documents and Settings\Administrator> netstat -aon | findstr "5037"
- TCP 127.0.0.1:1130 127.0.0.1:5037 TIME_WAIT 0
- TCP 127.0.0.1:1269 127.0.0.1:5037 TIME_WAIT 0
- TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3088
- TCP 127.0.0.1:5037 127.0.0.1:1128 TIME_WAIT 0
- TCP 127.0.0.1:5037 127.0.0.1:1129 TIME_WAIT 0
- TCP 127.0.0.1:5037 127.0.0.1:1270 TIME_WAIT 0
C:\Documents and Settings\Administrator>tasklist -fi "pid eq 3088"
- Image name PID session name session # memory usage
========================= ====== ================ ======== ============
- adb.exe 3088 Console 0 3,816 K
C:\Documents and Settings\Administrator>taskkill /f /pid 3088
- Success: terminate the PID for the process of 3,088.
C:\Documents and Settings\Administrator>adb start-server
- daemon not running. starting it now on port 5037 *
- daemon started successfully *
I've already up-voted another answer here to this question, but just in case anyone was wondering, you don't need to restart Eclipse to get ADB running again. Just open a shell and run the command:
adb start-server
If you haven't set the path to ADB in your system properties then you must first go to the directory in which ADB exists(in Android\android-sdk\platform-tools....I'm running Windows, I don't know how the mac people do things).
Run over to sysinternals.com and pick up TCPVIEW and PROCESS EXPLORER, if you don't have them installed already.
For some reason, the ADB daemon is terminating before the close socket exchange is complete. If you run (from the command prompt) "NETSTAT -o", you will see the socket (generally 5037) in CLOSE_WAIT state and the owning process number. Process Explorer won't show that process ID (the daemon terminated), and the process called adb.exe (which opened the socket) will be gone. (If adb.exe if found, try killing the task and see if things get cleaned up.)
Using TCPVIEW, locate the hung socket. The process name column will show the associated process can not be found. Right click, and select "Close Connection". The socket is now closed, and the adb daemon should be able to start.
I had a similar issue. Killing an existing instance of the ADB process from Task Manager did not work for me.
Just few days back, I had tried to install MIPS SDK and ADT-17 earlier and Eclipse gave me the error, and I did not fix that issue.
So, now, when I got this ADB server didn't ACK, failed to start daemon... issue, I executed 'Check for Updates' in the Eclipse Help menu item.
There were no updates available, but at least 'ADB server did not ACK' error disappeared.
I hope this might help in a few cases.
Type ./adb nodaemon server in a terminal.
If it returns Invalid content in adb_usb.ini, then there is a problem with your adb_usb.ini file in the .android folder.
Open adb_usb.ini and erase its contents. Then restart the server...it worked for me.
Check for the path of the Android directory. It should not contain spaces, etc.
Also check if the plugin has been properly configured in Eclipse → Preferences.
In my case I had everything checked multiple times, but it was still not working. I was about to reinstall everything, but I came upon an answer on this site (some other post).
Do check your antivirus. It may be blocking the ports of adb.exe or emulator programs, etc. That solved the problem in my case.
In addition to #Bastet's solution:
Actually we have to kill the process using the address 0.0.0.0:0. That's why for most of the people killing adb.exe from Task Manager was working (in my case I was not able to see it even in Task Manager).
Following the #Bastet steps, I found out that some other process was using this address. I went ahead to kill it, and it gave me ACCESS DENIED as Error.
So using the tasklist | findstr **** I found out the name of the process and killed it from Task Manager.
Thereafter it started working.
In my case bas_daemon and bas_helper were using this address both of which corresponds to MOBOROBO.
I had the same problem. But there was no process of adb on my laptop. I just log out and log in to my account, and it's resolved...
ADB could start from CMD windows after that.
The best and the most efficient way without restarting any device or software is:
Run the following:
adt-bundle-windows-x86_64\sdk\platform-tools\adb.exe
And one more thing.. ADB is a self-dependent thing. You cannot do anything until unless it wants itself to work. There is one more way which I found out: Leave the device connected for 5-6 minutes and wait. Soon the device gets connected and tries to launch.
This didn't start happening for me until I rooted my Samsung Galaxy S III phone (following the xda-developer forum guide).
It happens pretty randomly, but it's definitely occurring while running Eclipse.
Killing the adb.exe process and restarting it solves the problem.
Look at the antivirus or firewall... Does any of that block you from access... In k7 antivirus I turned off system monitor, and it does works for me...
Linux/Ubuntu users this might also be the case.... i had an android emulator running and I had to kill that. To do that do the following
lsof -i :5307
(use sudo if needed)
Note the pid in the result of above command. Then
kill -9 <pid_from_above>
then go ahead with
adb shell
I had to allow adb.exe to access my network in my firewall.
Killing Eclipse and then rebooting did not help me. I added the Android tool to the PATH variables, started Task Manager and killed adb.exe.
I restarted Eclipse, and then it worked.

Categories

Resources