ADB server not running - android

When I run ADB and type in "adb start-server" it says
*daemon not running. starting it now on port 5037 *
could not read ok from ADB Server, error = 109
*failed to start daemon *
error: cannot connect to daemon
what should I do? I've tried killing the server and restarting the pc but nothing seems to work. my pc recognizes the phone and the adb process only appears briefly when i try to start the server. also, it gets stuck on wating for device when i type "fastboot oem unlock"

Looks like windows is messing up the ports (reserving them). I have the same issue with docker containers and this worked for me:
Run this in the command line (as administrator)
net stop winnat
adb.exe start-server
net start winnat

Happened with me as well. Just check there might be an existing adb process running in your task manager. Just kill the process and run the 'adb start-server' command.
Hope it helps

Happened to me today.
I realized it happened when I started Android Studio after having my Genymotion emulator running, so I fixed it by closing everything (even check task manager for a running instance of adb).
After closing everything, I opened Android Studio first and then the emulator and everything was ok.

In my case the issue was in IntelliJ IDEA plugin - Aladdin Logcat. Turned it off and everything works now.

This happened to me because I had Oculus Developer Hub open.
Even if you're not using its adb features, it will constantly try to start its own version of adb and kill the one you're trying to launch.

Related

Android Studio error: cannot connect to daemon

I've been using AS for months, but since two days I get an error when I try to run my app:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
I've read about a lot of people having this problem, but the solutions provided don't work for me. I read these questions in particular:
Daemon not running. Starting it now on port 5037
Android ADB - Daemon still not running
How to resolve the "ADB server didn't ACK" error?
Eclipse error "ADB server didn't ACK, failed to start daemon"
Adb won't start
How to resolve the "ADB server didn't ACK" error?
Daemon not running. starting it now on port 5037 * Cannot open 'nul': The system cannot find the file specified
A lot of answers to these questions say to close adb.exe from task manager, the problem is that adb.exe is not running and if I try to restart it by typing .\adb start-server on a PowerShell window I get the same error.
I also try to restart my PC but it didn't work.
On the Android device I'm trying to connect to (Samsung Galaxy S8) I enabled USB debugging. I even tried to eliminate all the authorized devices, but nothing worked.
I checked if the 5037 port was used by other processes, but it is used by adb.exe (and the firewall state on that port is allowed and not limited). By the way, as I said, in the task manager adb.exe is not present.
Last I tried to follow the instructions provided in the last question I linked (basically I re-downloaded adb.exe).
Initially I ran .\adb start-server and this strange error occurs:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
** daemon still not running
error: cannot connect to daemon
and then when I try to run my app on Android Studio it occurs this new error when it tries to start adb:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
ADB server didn't ACK
* failed to start daemon *
and then if I try to .\adb kill-server and then .\adb start-server or .\adb devices or .\adb usb the same error occurs again.
Moreover when I connect my device now it asks me to authorize my PC to connect.
I don't know if this can help, but lately I deactivated a lot of Windows services (but I don't think I deactivated something related to Android Studio).
Details
PC: Compaq
PC OS: Windows 10 Home
Device: Samsung Galaxy S8 (Exynos)
Device OS: Android 8.0
AS version: 3.0.1
The solution which worked for me -
Open Command Prompt as administrator and type
adb start-server
That's it
I had same problem a moment ago. I solved it:
Run CMD as Administrator
Enter adb devices to CMD.
The output for me is :
C:\WINDOWS\system32>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
P9BCS87ABS9SCD5 device
Usually that's caused by the WinNAT service, restarting which solves the issue.
Just open the Command Prompt or PowerShell as Administrator, and type the following commands there:
net stop winnat
net start winnat
And wait a bit for the Android Studio to reconnect to the ADB.
P.S. If it doesn't reconnect, just type the following commands to restart the ADB:
adb kill-server
adb start-server
I solved the problem on my own.
Out of frustration I opened Control Panel > System and security > Windows defender firewall > Allowed applications and I added adb.exe (both private and public networks).
I came back to Android Studio, ran the app and magically it managed to initialize ADB and my phone connected via USB was there.
I don't really know why this worked, since when I checked in Start > All Programs > Accessories > System Tools > Resource Monitor > Network > Listening Port it said that on port 5037 the firewall was allowed.
Moreover I don't know why up to a week ago all worked fine and now I had to do this process to make it work.
If someone more experienced manages to explain this behaviour better I'll update this answer (or accepts his as best answer)
Run CMD or PowerShell as administrator
Then run the following commands:
net stop winnat
In correct folder run:
adb start-server
net stop winnat
Below solution solved my problem:
Go to your task manager
see if adb is running
right click & end the task
Go to command prompt
run adb devices
it will work fine
For my situation
The latest platform is version 30.0.3. I also have the same problem as this:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
My solving:
Step 1: downloading platform-tool version 28.0.1: https://developer.android.com/studio/releases/platform-tools#2801_september_2018
Step 2: remove platform-tool: go to SDK Manager -> SDK tools
Uncheck "Android SDK Platform - Tool"
Click Apply
Step 3: Going to folder android -> SDK and pass new platform-tool
Step 4: ADB devices.
Then It's working for me.
SDK Manager -> SDK tools
Uncheck "Android SDK Platform - Tool"
Click Apply
After using Android Studio and Emulator without any problems, suddenly it stop to connect to the Emulator, even adb server was running (killing and starting), firewalls raised for all the programs (adb.exe, qemu-system-x86_64.exe, studio64.exe, etc), port 5037 freed, uninstalled and installed again the programs, even the whole Android Studio from scratch. I got verything running OK, but no connection between AS and Emulator.
The solution to my problem was to run Android Studio AS ADMINISTRATOR, it seems that when I updated the program to 3.5.2 somehow the status changed, causing me the problem.
What worked for me in all adb unresolved cases:
adb kill-server
or
adb disconnect
I would just try them both and one will do the trick.
I had this issue several times. It seems if when system is starting, device is connected by USB cable, daemon will connect correctly and no problem will occur. Of course I want a better solution, because it is very hard for me to shut down and start again every time.
Had same issue after upgrading to Android Studio Bumblebee | 2021.1.1
To solve it, go to Settings -> Build, Excecution, Deployment -> Debugger
Then uncheck the option Enable adb mDNS for wierless debugger
I had the same error.
Error on android studio
i use easytether, which was causing the error when is connected.
http://www.mobile-stream.com/easytether/android_faq.html#adbmacosx
After u disconnect it, everything should work fine.

ADB server can't start android

I have installed adt bundle eclipse. However, I can't seems to run the AVD. I have the problem of
ADB server didn't ACK
failed to start daemon
I have search on how to solve it, I've read to type adb kill-server and adb start-server. when I typed that, it says
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *"
Please follow below steps:-
Go to run
open command prompt
get into your platform-tools under android sdk.
now type command: adb kill-server
then upon success type: adb start-server
Thats'it.
Let me know if you still facing any issue..
I had this exact problem on my Vista x64 system. I solved it by doing the following:
Ctrl-Alt-Del, start Task Manager, under Processes tab, check for "shuame_helper.exe". It was there from running RootGenius. I clicked End Process, then went back to the command prompt and entered adb start-server and it worked!
Try below step from DDMS in eclipse :
So I had the same problem and failed in all the same ways as above:
adb kill-server
followed by
adb start-server
still resulted in the ADB server didn't ACK error.
The other common suggestion of using the task manager to kill the process also
failed as it seemed that something restarted adb automatically? It would disappear for a second, then there were two adb processes ,then there was one again.
Exasperated.
I restarted Windows in safe mode.
This ensured that adb wasn't started.
Shut down and restart normally. Problem solved.
Just for good measure, I also updated eclipse and android at this point, but I think that the safe mode restart fixed it.
Give it a try when all else fails.
When this happens I open Activity Monitor (on mac) or Task Manager (on windows) and look for the ADB process and force close it (sometimes there are more than one, close those to) and then press the Run button again in Android Studio or Eclipse.
1)Open task manager first
2)close any instance of adb.exe(end task it)
3)open command prompt
4) type adb start-server(you may have to execute it twice)
5) try to run now.
I had this problem using the latest ADT, SDK and Eclipse on Windows 7. I had an old ASUS TF101 and an HTC HD connected with their respective docking software. When I looked in processor tab of the Windows task manager I could see two instances of the adb.exe, one loaded and another one looking like it is trying to load.
I killed the PC connecting software (process in task manager) for the ASUS, the HTC Sync wasn't running. There is now one adb.exe running and both devices are recognised in Eclipse and in the command prompt (adb devices). You may need to restart Eclipse.

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.

Android ADB didn't ack issue in eclipse

I have spent around 5 hrs on this problem. I have read the same question on stackoverflow, but none of the solutions solved my problem...
First, it gives me:
[2013-02-28 14:48:21 - adb] ADB server didn't ACK
[2013-02-28 14:48:21 - adb] * failed to start daemon *
To solve that, I kill the adb.exe in task manager, restart eclipse. Then go to DDMS, reset adb. NO LUCK...
Then, I go to command line window, type adb kill-server and adb start-server, it gives me:
adb server is out of date. killing...
ADB server didn't ACK
fail to start deamon
Now I don't know what to do. I have a project to develop on eclipse, so really need to solve this problem soon. Someone please help!!
(As many solution indicated, I killed my adb.exe thousands of times, but it showed up immediately in task manager after 2 seconds. )
I had the same problem, here is what actually helped me:
Go to platform-tools in Android SDK directory.
Type:
adb nodaemon server
Output:
cannot bind 'tcp:5037'
Now I know the reason adb not responsive is because it can not bind to port 5037. Use following command to find out the process that occupies the port:
netstat -ano | findstr 5037
Output:
Note that process with PID 4888 is occupying port 5037.
Open Task Manager, click on Details tab, find the process and kill it, tfadb.exe in this case. it may vary for me it is sh.exe and port 4599 and delete all adb.exe
Retry adb kill-server and adb start-server, hopefully adb is up running fine.
Killing the process in the TASK MANAGER solves it in my case. After killing it run adb start-server or adb devices and you should be fine
solved the problem.
Because I have a small assistant plugin installed on my pc, it has an adb.exe running in the background all the time. So after I uninstalled the plugin, the error has gone!
I have an HTC device, whose driver software (HTC Sync) tried to run processes using adb at the same time that I was trying to run from Eclipse. If you have a program like HTC Sync for your device that might have been needed to install the driver, close this program to keep it from executing adb in parallel. So far for me, this has fixed it 100 percent.
Sometimes when we are running SnapPea, it is running a background process called "wandoujia_adb". when killing the process and running the command "adb start-server" in cmd promt, i get the following o/p text to cmd promt:
C:\Users**>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Here Is your Solution
Kill ADB process
CLose Eclipse
Remove Lock File .metadata of workspace
Ensure Only one Java Whether JDK or JRE in installed
if found remove the previous version
Use Ccleaner to remove Temp files
Clean Registry too
Restart the system
Restart Eclipse
If you have your device connected and you are trying to test through an emulator, make sure that a device sync agent isnt running in the background. This relaunches the adb even after you kill it in task manager.
I have tried many approaches I've found here, but just one worked out perfectly:
UNINSTALL AVAST ANTIVIRUS!
I had a mobogenie plugin installed on my machine which was continuously running adb. Uninstalled it and got the problem solved.
In my case I was using the mobogeine universal driver, when I end task adb.exe from task manager, It restarts again in 1-2 seconds occupying another port number.
To get rid of this problem I have to disconnect my phone & 1st kill mobogeine driver, then adb.exe does not restarts agian. Now run adb start-server . If the success message shown then everything worked perfectly.

Adb server not responding [duplicate]

This question already has answers here:
Eclipse error "ADB server didn't ACK, failed to start daemon"
(23 answers)
Closed 4 years ago.
I am a Android newbie. I guess I might be doing something stupid here. I have started the Virtual Device and I see that adbd daemon is running from the Terminal Emulator. When I run adb devices I get the following error:
C:\Program Files\Android\android-sdk\tools>adb devices
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
No other process is using port 5037. What am I doing wrong? Here are the packages I have installed -
1) Android SDK Tools, revision 10
2) Android SDK Platform-Tools, revision 3
3) SDK Platform Android 2.3.3, API 10, revision 1
This will occur normally,if abd is not able to launch properly and didn't exit when adb kill-server is executed.
So if in Windows
1. Go to Task Manager (CTRL+ALT+DEL)
2.look for adb.exe and end the process.
Now restart the emulator ,should work properly.
additionally you can close and launch the development environment also (eg: Eclipse or NetBeans).
I suspect the problem is cause of many adb instances (in windows) , i usually face this problem cause i don't turn off my system so the adb process may not end properly.
So open task manager choose Process tab just search for adb.exe, right click on it and choose End Process Tree rather than just End Process
Had the same problem, it seems that my security solution was blocking adb.exe
this is not the right folder for adb : lately adb has moved from /tools to /platform-tools in the sdk folder.
Seems like the security program is blocking adb.exe, so go to the adb file path and open adb's properties, then check the Run this program as administrator setting.
In my case the process adb.exe starts when i connect the phone, and then when I adb devices then I have your problem, and killing the process does not help it is resurrecting like a stubborn zombie, as long as the phone is connected.
so my solution was to disconnect the phone, then kill adb.exe process, then start it by adb devices and connect the phone
After that when i command adb devices i ma getting the same prompt about killing adb out of date, but this time on the second line is * daemon started sucessfully*
win xp
htc sensation
the new eclipse adt sdk bundle from google so i suppose up to date.
I found there was a process call "Tadb.exe" in Windows Task Manager.
I guess Tadb.exe is a similiar adb application of Tencent. Because I got an alert of "android device detected by QQ" after I install the last version of Tencent QQ2013 Beta5 (6970) yesterday.
After I killed the Tadb.exe, the original adb.exe of Android SDK works again.
You can see the detailed proecss to solve this problem here:
adb cannot run, adb server is out of date
I turned off the Windows Firewall and its working like magic. I am connected to the Internet through WiFi. If you are not behind a proxy and are still unable to access the Internet through a wireless link via the emulator, go to Device Manager and disable your LAN card.
As I have tried as follow by combining omni.present's method , and finally emulator works fine.
firstly I stop adb.exe process in the task manager
then I stop and start eclipse
The fundamental reason is because the 5037 port on your machine to be occupied by a process, not only Android devices can not use adb connection ios device not use iTunes.
Can query process and close it, netstat / a / o maybe can help you to take up to 5037 ports.
To windows7 the LogsAndAlerts service will occupy port 5037.

Categories

Resources