I am trying to terminate adb.exe on my Windows machine. I am using taskkill /F /IM adb.exe /T to do this. However each time I do it, 3 adb.exe instances come back into the task manager process view. Something is restarting them.
I'm trying to do some connection-between-virtual-machine stuff and I need adb.exe to die and stay dead on the Windows host, because it is interfering.
How do I identify what is restarting these processes? Or otherwise make adb.exe stay dead without doing extreme stuff like temporarily deleting it from the Windows host?
Extra notes:
When I run the taskkill, a process group called "Service Host: DCOM Server Process Launcher" jumps to the top of the process list at 20% cpu, so maybe it's what is responsible.
No, adb kill-server etc is no more effective.
It may help you if you look at process explorer. It resolves process trees and may lead you to the starting process.
https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx
However, if I start the adb server through a command promt, it shows adb.exe as subprocess of cmd.exe only for some seconds and then gets handed up as independend process. You might want to have the process explorer open and monitor the restarting procedure of adb.exe.
To kill adb you can use adb kill-server and start it with adb start-server
adb.exe is platform-tools folder in your Android SDK.
Also you can get it from chocolatey packages https://chocolatey.org/packages/adb
I had the same issue. In my case it was a gradle daemon who was keep restarting an adb server. To prevent him doing so, I used gradle --stop.
For anyone with a similar issue:
When using flutter, check if you have two adb.exe executables.
Run cmd
Type cd.. to exit current directory
Comes to the main directory i.e.C:> directory
Now type adb kill-server and press enter
Now go to the adb directory means the path where adb is located ex.-> [your path]\AndroidStudioProjects\sdk\sdk\platform-tools
Delete the adb.exe
Download latest platform-tools from here
Unzip it
copy the complete folder and paste inside [your path]\AndroidStudioProjects\sdk\sdk\platform-tools
For Windows users:
Simply Open TaskManager --> Processes --> Background processes --> Select ADB --> End Task.
It will stop ADB from running in the background.
My Android Studio has an adb file inside /home/myuser/Android/Sdk/platform-tools/ with the version 1.0.41.
Note where I put myuser could be your name, whatever, just locate your Android path.
My error was:
adb server version (41) doesn't match this client (39)
When you type just adb in terminal, this command will be related with the adb archive inside /usr/bin.
So, I did these steps inside terminal:
adb version
Android Debug Bridge version 1.0.39
cd /usr/bin
sudo rm adb
cd /home/**myuser**/Android/Sdk/platform-tools/
Please check if there is an adb file inside your path
Now copy to /usr/bin
sudo cp adb /usr/bin
adb version again
Android Debug Bridge version 1.0.41
With this done, both of them have the same adb file.
If in the future the SDK Manager asks to upgrade platform-tools and the error appears again, remember to perform these steps again.
Related
This question already has answers here:
Adb won't start
(21 answers)
Closed 6 years ago.
I could not run the android application never on my laptop. Eclipse gives same error constantly, that is "ADB server didn't Acknowledge"
I've tried everything, restart adb from ddms view, from command line (kill-server, start-server), from task manager and restart eclipse. When I manage to start adb server and re-open eclipse, as soon as I run the android application, same error comes to console; ADB server didn't ack.
Could you give an idea except restarting adb
Killing the process adb.exe in the TASK MANAGER (to open task manager CTRL+Shift+Esc) solves it in my case. After killing it run adb start-server or adb devices and you should be fine.
Incase if that doesn't work
We can solve this issue so easily.
Open command prompt, 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 command prompt
A way bit difficult approach
Command Prompt (cmd.exe)
netstat -aon|findstr 5037
find 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
for more details check it from here
For Mac users, what worked for me was:
Open Activity Monitor (equivalent to Windows task manager)
Kill the adb task
Restart adb
Please kill adb by command:
taskkill /f /im "adb.exe"
then, re-start it with command:
adb start-server
It work very fine for me :)
Look for typos in the ~/.android/adb_usb.ini file. This problem can be caused if that file gets messed up.
In my pc, i use the command line taskkill /f /t /im wandoujia_daemon.exe (because adb.exe or bas_daemon.exe is not running in my task manager)
And... the adb server is started succesfully
in my case i use the command line taskkill /f /t /im bas_deamon.exe (because adb.exe was not started) and adb server is started successfully
In addition to #maveňツ solution.
Actually we have to kill the process using this 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 Task Manager).
Following the #maveňツ steps I find out that some other process was using this address.
I went ahead to kill it, it gave me ACCESS DENIED as Error.
So using the tasklist|findstr **** i find out the name of the process and killed it from task manager.
There after it started working.
In my case bas_daemon and bas_helper were using this address both of which corresponds to MOBOROBO
Kill ADB from command prompt.
Kill eclipse also from command prompt.
Start adb server from there using [adb start-server]
And start again.
I believed you've checked the port number, and restart adb. But have you install proper android driver on your computer. Some universal android driver may not work on your computer, you'd better installed the driver provided by your mobile manufacturer, if you can't find the driver on manufacturer's website, consider download its software suit, it may include the driver.
This question already has answers here:
Adb won't start
(21 answers)
Closed 6 years ago.
I could not run the android application never on my laptop. Eclipse gives same error constantly, that is "ADB server didn't Acknowledge"
I've tried everything, restart adb from ddms view, from command line (kill-server, start-server), from task manager and restart eclipse. When I manage to start adb server and re-open eclipse, as soon as I run the android application, same error comes to console; ADB server didn't ack.
Could you give an idea except restarting adb
Killing the process adb.exe in the TASK MANAGER (to open task manager CTRL+Shift+Esc) solves it in my case. After killing it run adb start-server or adb devices and you should be fine.
Incase if that doesn't work
We can solve this issue so easily.
Open command prompt, 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 command prompt
A way bit difficult approach
Command Prompt (cmd.exe)
netstat -aon|findstr 5037
find 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
for more details check it from here
For Mac users, what worked for me was:
Open Activity Monitor (equivalent to Windows task manager)
Kill the adb task
Restart adb
Please kill adb by command:
taskkill /f /im "adb.exe"
then, re-start it with command:
adb start-server
It work very fine for me :)
Look for typos in the ~/.android/adb_usb.ini file. This problem can be caused if that file gets messed up.
In my pc, i use the command line taskkill /f /t /im wandoujia_daemon.exe (because adb.exe or bas_daemon.exe is not running in my task manager)
And... the adb server is started succesfully
in my case i use the command line taskkill /f /t /im bas_deamon.exe (because adb.exe was not started) and adb server is started successfully
In addition to #maveňツ solution.
Actually we have to kill the process using this 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 Task Manager).
Following the #maveňツ steps I find out that some other process was using this address.
I went ahead to kill it, it gave me ACCESS DENIED as Error.
So using the tasklist|findstr **** i find out the name of the process and killed it from task manager.
There after it started working.
In my case bas_daemon and bas_helper were using this address both of which corresponds to MOBOROBO
Kill ADB from command prompt.
Kill eclipse also from command prompt.
Start adb server from there using [adb start-server]
And start again.
I believed you've checked the port number, and restart adb. But have you install proper android driver on your computer. Some universal android driver may not work on your computer, you'd better installed the driver provided by your mobile manufacturer, if you can't find the driver on manufacturer's website, consider download its software suit, it may include the driver.
I'm developing android apps in eclipse and I upgraded recently from Ubuntu 12.10 (Quantal Quetzal) to Ubuntu 13.04 (Raring Ringtail).
In the previous Ubuntu version I had zero problems in recognizing my android device.In this new Ubuntu version I must do:
sudo adb kill-server
and
sudo adb start-server
in order to Ubuntu recognize my android device.
Everytime I restart my computer it appears question marks in eclipse when I try to debug an app, and I have to run these command lines everytime to make it work.
Anyone knows if there is a way to recognize my phone permantelly?
adb "flakiness" is a common problem, you have the right idea to start adb with root permissions.
If you have eclipse running and run it as two separate commands, there is a chance that eclipse will have tried to startup adb as a non-root user before you have run your start-server, so I recommend running in a single command line:
sudo adb kill-server && sudo adb start-server
Also you want to make sure you have only one copy of the sdk installed and that eclipse is using the same copy as is on your path at the command line.
Possibly could throw the run-as-root logic into an init script so that when you restart the computer it comes up as root - I haven't tried this though, always just "control-r, start-ser" from the command line =)
I had the same problem and solved it by
just change the owner of adb to root and restart then in future the problem won't happen again.
use this:
sudo chown root:root -R /opt/..../sdk/platform-tools/*
sudo /opt/..../sdk/platform-tools/adb kill-server
sudo /opt/..../sdk/platform-tools/adb start-server
In ADB, I am facing an error when I am trying to print the version with
padmakumar#padmakumar-desktop:~$ adb version
Android Debug Bridge version 1.0.29
but its showing below error
padmakumar#padmakumar-desktop:~$ adb devices
error: protocol fault (no status)
NOTE: adb kill-server is not working i.e it's not responding.
and in my Eclipse console I am getting this error:
Android Launch!
[2012-01-09 20:31:28 - Shopping List] The connection to adb is down, and a severe error has occured.
[2012-01-09 20:31:28 - Shopping List] You must restart adb and Eclipse.
[2012-01-09 20:31:28 - Shopping List] Please ensure that adb is correctly located at '/home/padmakumar/android-sdk/platform-tools/adb' and can be executed.
I also came across the same error when I was trying to install one app in emulator. You need not restart PC to overcome this. Just kill the server. if 'adb kill-server' is also not working, kill the process (adb.exe) through task manager. There you go!!
Task Manager -> Process -> adb.exe -> End process
That worked for me.
If zombie adb process is not the issue i.e. there's no adb.exe in the task-manager list, the problem is usually adb ports e.g. 5555, 5554, 5037 etc., being taken by other applications.
Solutions:
On all Windows: find the process taking one of those ports using netstat -bn and kill it from task-manager Ctrl+Shift+Esc is the shortcut.
On Windows 7 and 8: there's this new tool called Resource Monitor. It'll also allow you to find out the blocked port and blocking process under the network tab.
On Linux: the similar is done with netstat -pn. Feel free to use your grep foo as needed and kill the blocking process with kill or pkill.
Change Default ADB Port: Apparently default ADB port can be changed as described here by setting up an environmental variable before launching ADB. Give it shot. It'll allow more flexibility if you don't want to kill the blocking processes.
navigate to adb.exe folder
shift + right click inside the folder
start commandline from here
unplug any android device connected to your PC
type "adb.exe wait-for-device"; press Enter
connect your device; wait for commandline to finish
done
adb kill-server did not work on my Linux computer
First, I used ps -ef | grep adb and killed all adb deamonswhich did not solve the problem.
Then I usedps -ef | grep javaand saw a process that was blocking theadb`.
Upon killing that process, adb worked perfectly.
Maybe this process can be helpful for someone.
On trying to kill multiple adb.exe processes from windows Task Mgr it said "Access is denied". On Windows 7, Resource Monitor allows those adb.exe processes to be killed.
install following packages
sudo apt-get install lib32z1 lib32z1-dev lib32stdc++6
if you are using Genymotion then set path of Android SDK in its settings.
ref :http://www.intellicode.in/adb-not-responding-wait-more-or-kill-adb-or-restart/
Install again ADB.EXE in your SDK path like
Steps :
1)Close Your Android Studio
2)Fine path in Your Computer->[drive][your SDK path]\Sdk\platform-tools
3)Replace this path at adb.exe File or Download again if not updated adb.exe File.
4)Click on adb.exe if the command prompt is open and details see and then close automatically then its work. OR if any error occurred or not start adb-server again replace this file .
5)Now successfully run your adb-server open android studio and connect your device after Developer Option ON .
If using the "kill-server" parameter doesn't work you will have to kill the process itself.
In case you use GNU/Linux you have to use the command "ps aux|grep adb" to find the pid of the adb proccess, or directly with "pidof adb" and then "kill PID" where PID is the pid number of the adb process. This should also work with Macintosh and other Unixes (although the parameters of the "ps" command may be different)
In Windows just open the task manager to and kill the adb entry in the proccesses table
From James Tan's answer:
After investigating for a long time, finally i found out that adb
daemon keep restarting. and it is because my chrome have enabled
android debugger. In chrome address bar, open:
chrome://inspect#devices, then uncheck Discover usb devices.
Next:
Open Power Shell as administrator
cd C:\Users\PC01\AppData\Local\Android\Sdk\platform-tools
./adb kill-server
./adb start-server
Running Vista, tried starting adb from shell as admin get daemon not running starting it now
ADB server didn't ACK
* failed to start daemon *
Any help for this?
This problem has annoyed me for a long time. In addition to the above answer, use these tips:
Create a bat file with the following and run it. This bat file will solve most of your adb problems.
tskill adb
cd \tools\
adb kill-server
adb start-server
ddms
Use the command netstat to monitor the state of connections (adb uses 5037)
If the bat file doesn't work try: disconnect-reboot phone-connect. (hint: use `adb reboot' if adb is responding at all, if not do it the old fashioned way)
Sometimes Windows can be funny. Reboot the machine.
Turn on USB Debugging Mode
Download the Android SDK and unzip
Uninstall all "Android *" from Device Manager
Do an "Add Hardware" from Control Panel, choosing "Install the hardware...
(Advanced)"
Select "Android USB Devices" and click "Next"
Click "Have Disk" and enter the path where the SDK was unzipped
Still not working ? Factory reset the phone.
MTP detection delays ADB. Sometimes you if need boot time logs you may have to disable the MTP driver in Device Manager (Windows)
This is a brilliant patch for adb when you get the error :
Adb connection Error:An existing connection was forcibly closed by the remote "
I was unable to use adb. I got the following error, both on the command line and in eclipse.
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK<br>
* failed to start daemon *
That is, adb start-server failed even after rebooting. To diagnose the problem, I found that you can run adb with the following arguments:
adb nodaemon server
And it will print out the reason that it cannot run. In my case, it was a blank line in the adb_usb.ini file.
You may have a stuck copy of the adb daemon in memory. Try removing it with Task Manager, or reboot, and see if that helps.
For whoever is using Android Studio and MAC. This is what worked for me:
In Android Studio: Tools -> Android -> Uncheck "Enable ADB Integration"
In terminal: "adb kill-server"
In Android Studio: Tools -> Android -> Check "Enable ADB Integration"
In terminal: "adb start-server"
The top answer is Windows-specific but this has a decent amount of Google visibility, so if you're running a *nix-like machine (I'm on a Mac), the steps are similar:
$ killall adb
$ cd <PATH_TO_SDK>/platform-tools/
$ adb kill-server
$ adb start-server
Or, if you're like me and just want to access adb no matter your current directory, add
export PATH=${PATH}:<PATH_TO_SDK>/platform-tools/
to your ~/.bash_profile.
> killall adb
> adb start-server
Restart Eclipse.
Basically adb is running on another process on your box, and you need to kill it, and start up the daemon again, since they're both trying to bind to the same port (:5037). In my case, I had another window open to :5037, and forgot about it. Wondered why I couldn't stop and start as usual. By going "killall" you make sure you're terminating all processes. You can also go into the CPU's processes and force quit.
adb nodaemon server
helps. In my case, I had edited ~/.android/adb_usb.ini, and added 0x1949 at the end to enable debugging on the Kindle Fire. Sadly, it could not handle the newline(s) I put in after the 0x1949
1.$ apt-get remove android-tools-adb
2.$ cd $PATH_TO_SDK/platform-tools/
3.$ ./adb devices
You will see like this:
daemon not running. starting it now on port 5037 * cannot bind 'tcp:5037' ADB server didn't ACK * failed to start daemon *
That show what errors.
Now you reset you PC, it will well.
Or
# lsof -i:5037
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
wineserve 3609 root 268u IPv4 20118 0t0 TCP localhost:5037 (LISTEN)
#
You will know which software use the port.
To avoid this simply change the following values in your host_config.xml:
<!-- Number of tests executed between reboots. A value <= 0 disables reboots. -->
<IntValue name="maxTestCount" value="10000" />
<!-- Max size [tests] for a package to be run in batch mode. -->
<IntValue name="maxTestsInBatchMode" value="100000" />
<!-- Max time [ms] between test status updates. -->
<IntValue name="testStatusTimeoutMs" value="600000" />
I had the same problem. I had improperly edited my adb_usb.ini file (I had two carriage returns at the end of the file...yes this was hard to find.)
This file is located somewhere similar to /Users/{user-name}/.android/adb_usb.ini
(replace {user-name} with your own user name)
Make sure the file reads EXTACTLY (No spaces/carriage returns/line breaks before or after):
'# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT."
'# USE 'android update adb' TO GENERATE."
'# 1 USB VENDOR ID PER LINE."
(IMPORTANT!!! There are no ' (apostrophes) in the actual file, this was the only way for me to post this without it interpreting the # for BOLD).
Hope that helps someone
If you're using Android Studio, if
you have the "Device chooser" dialog open
you try to run "adb devices" from your command line
it leads every single time to the following error
adb server is out of date. killing...
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
SOLUTION (easy and quick)
Close the "Device chooser" dialog. My guess is that it tries to take over the adb connection in a.. very intensive way.
I'm facing this issue with Genymotion, so I've replaced it's adb with my current adb. For reference:
cd $GENYMOTION_HOME\tools
mv adb adb-old
ln -s $ANDROID_SDK\platform-tools\adb adb
There is yet another possibility. If you have installed any permission managers, like Advanced android permission manager , the adb may fail.It was my case. Uninstalled the app and then no issues.
It seem are the same,
but sometime, the command adb kill-server have no effect (at least is in my case).
So, i have tried other way.
You can check this way: https://stackoverflow.com/a/34627522/5597864
In a console, try:
taskkill /F /T /IM adb.exe
Do this many times, until it says ERROR: The process "adb.exe" not found.
Then
adb devices
The adb server is not running. you can open the command line window in Windows to check which process is using the 5037 port, remember the process number.
netstat -ano |findstr "5037"
Then use the Ctrl+alt+delete to open the process manager to kill the process which is possessing the 5037 port. You maybe need to try this several times until the 5037 port is free to use.
Open Command
Navigate your adb.exe file where is located
Reach into the file on command
adb kill-server
adb start-server
When it additionally says that adb server is out of date. killing... it kills it for you.
The problem is it restarts as soon as was killed.
So you should consider finding the adb.exe wherever it could be.
The simplest way to do that is opening a Task Manager, finding an adb.exe process -> RMB -> Open file location -> delete it from there. Unless it's not needed, in this case you should update it.
In my case it was in C:\Windows\ and came with their Visual Studio.
If you are getting the error cannot bind 'tcp:5037' and you are using any Linux distribution such as Ubuntu,
Kill old ADB process:
fuser -n tcp -k 5037
This will kill the adb process at port 5037 and then,
Start ADB:
adb start-server
Usually the answers given here worked for me, but today they didn't. My problem was fixed by updating the emulator and SDK to the latest versions from the SDK manager.
On A Mac or Unix
For those of you coming here with on Mac or Unix, the following worked for me:
adb kill-server
adb server