ADB is not starting (no error message)
Asked Answered
E

13

14

I am trying to run adb. When I run : "adb start-server" it hangs during a while, and then no message.

After that the command "adb get-state" receive the answer "error: protocol fault (no status)" If I run then "adb kill-server" the answer is "* server not running *"

I am using windows 7. An admin has elevated my rights to local admin, but it did not solve anything.

I used resources monitor to verify if any other app is using the ports of adb, but it is not the case.

on https://developers.google.com/chrome-developer-tools/docs/remote-debugging the step 3 indicates to "Enable USB Web debugging" under Settings > Advanced > DevTools. But on my test phone, there is no "advanced" category in the chrome settings. I couldn't find out either what is the version of chrome installed.

Somewhere on the web I saw a suggestion to change the rights of "tmp/android/" to allow read & write for all users, but in C:\Users\me\AppData\Local\Android\android-sdk\temp there is no android folder.

So I am pretty desperate now, any help would be immensely appreciated.

thanks

-olivier

EDIT 1: I could't find "Enable USB Web debugging" because it was "android browser" and not chrome (a bit ridiculous yes). I did not know that. Using another device with a proper chrome installed, I could check the option there, but adb is still crashing at startup.

EDIT 2: I did a wild guess that there was some Write issue with the platform-tools folder. So I uninstalled everything using the sdk manager, I deleted the whole adt-bundle-windows-x86_64. Then I unzipped it elsewhere, on c:. Strange thing is, when I launch SDKManager.exe, several packages are already marked as installed :

  • Tools>Android SDK Tools
  • Tools>Android SDK Plateform-tools
  • Android 4.2.2>SDK Plateform
  • Android 4.2.2>ARM EABI v7a System Image
  • Extras>Android Support Library

I tried deinstall them again, delete the folder, unzip again and re-install, but still same result. It seems that somehow, it is installed wrong, but refuses to uninstall properly. Anyone knows how to force the unistallation ?

EDIT 3 : output of adb start-server after having used set ADB_TRACE=1

C:\adt-bundle-windows-x86_64-20130219\sdk\platform-tools>adb start-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=100 len=12: 686f73743a76657273696f6e host:version
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 disconnected
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 100(lo-client:5037)
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:start-server
Estriol answered 27/3, 2013 at 15:41 Comment(3)
Check that there isn't a stray ADB process in the Task Manager. Sometimes I have an "atra" ADB process that gives me similar problems. I fix the issue by killing this process. Then do adb start-serverAnkney
When I run adb start-server, whilst the command is hanging, the adb.exe process shows up. But when I get the cursor back, the process disappears simultaneously. So there is no phantom process.Estriol
DONT USE THIS, IT IS OBSOLETE NOW.Estriol
H
7

Try setting the environment variable ADB_TRACE before starting the ADB server to see if it can provide any clues:

 C:\Android\android-sdk\platform-tools>set ADB_TRACE=1
 C:\Android\android-sdk\platform-tools>adb start-server

Please include the output in your question.

Heard answered 1/4, 2013 at 0:37 Comment(6)
Hmm .. did you ever see * daemon not running. starting it now on port 5037 * and * daemon started successfully * message?Heard
Your output seems to indicate that the program was able to connect to that tcp port (meaning that something is running?) but got disconnected after that.Heard
Yes adb is starting and then crashing without error message. I runned netstat -ano | find ":5037" /c and it outputs 0. So no other application is using that port. I also changed device, using a Samsung Galaxy tab. It is displayed correctly as GT-P7511 in windows device manager. It has "enable usb debugging" in chrome settings and usb debugging once connected in the general settings. So what else should I check ? If the culprit is not the device/driver. Is it then the operating system ? Is adb well tested on win 7 ?Estriol
If possible, maybe ask your admin to login to your computer and see if it works if we try running it with him logged in. If it still does not work, maybe ask him to disable any security software too. Not sure if it will help to ask him to reinstall the SDK while logged in as an admin.Heard
kies + installing the sdk under the sysadmin session did it !!! I can connect to the samsung tablet. Nexus does not work yet, but at least I got it running for one device. thanks a lot.Estriol
While I'm happy your "debug it this way" helped the OP to solve his problem, your ""answer"" is not really an answer and therefore I guess this deserves further investigations as I believe I am having the exact same issue. If you feel inclined to get to the cause of this issue, maybe you could have a look at my question here: #17116621Tiresias
G
8

This solution worked for me:

=> Check if adb is running in Task Manager, then kill it. Now Then try to restart it again via following method:

1) Shift + Right click in ...\android-sdk\platform-tools folder and select Open command window here

2) Use these commands: adb kill-server then adb start-server

If this method didn't work and you see something like this in Command window Killing adb...

Then apply following steps:

3) Close eclipse

4) Now kill javaw.exe Java(TM) Platform SE binary in Task manager And follow step 1 & 2 again.

It will surely work. :)

Ghats answered 7/1, 2015 at 14:0 Comment(1)
Just the second one did the trick for me, thanks ;) adb kill-server then adb start-serverSohn
H
7

Try setting the environment variable ADB_TRACE before starting the ADB server to see if it can provide any clues:

 C:\Android\android-sdk\platform-tools>set ADB_TRACE=1
 C:\Android\android-sdk\platform-tools>adb start-server

Please include the output in your question.

Heard answered 1/4, 2013 at 0:37 Comment(6)
Hmm .. did you ever see * daemon not running. starting it now on port 5037 * and * daemon started successfully * message?Heard
Your output seems to indicate that the program was able to connect to that tcp port (meaning that something is running?) but got disconnected after that.Heard
Yes adb is starting and then crashing without error message. I runned netstat -ano | find ":5037" /c and it outputs 0. So no other application is using that port. I also changed device, using a Samsung Galaxy tab. It is displayed correctly as GT-P7511 in windows device manager. It has "enable usb debugging" in chrome settings and usb debugging once connected in the general settings. So what else should I check ? If the culprit is not the device/driver. Is it then the operating system ? Is adb well tested on win 7 ?Estriol
If possible, maybe ask your admin to login to your computer and see if it works if we try running it with him logged in. If it still does not work, maybe ask him to disable any security software too. Not sure if it will help to ask him to reinstall the SDK while logged in as an admin.Heard
kies + installing the sdk under the sysadmin session did it !!! I can connect to the samsung tablet. Nexus does not work yet, but at least I got it running for one device. thanks a lot.Estriol
While I'm happy your "debug it this way" helped the OP to solve his problem, your ""answer"" is not really an answer and therefore I guess this deserves further investigations as I believe I am having the exact same issue. If you feel inclined to get to the cause of this issue, maybe you could have a look at my question here: #17116621Tiresias
H
6

To solve problem in windows machine, try the following:

Problem

ADB stop connecting attached Android device demon is not running and demon is running on port 5037

Solution

first list all processes which are running on port 5037 command: netstat -ano | find "5037" Output for above command:

TCP    127.0.0.1:52935        127.0.0.1:5037         SYN_SENT        31016
TCP    127.0.0.1:52936        127.0.0.1:5037         SYN_SENT        31016

Kill processes which are running on port 5037 using the following command: taskkill /F /PID 31016

Then, restart the adb server adb kill-server adb start-server

Expected output:

* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *

Typing adb devices will give you list of devices connected to the adb server

Hendry answered 26/7, 2017 at 4:52 Comment(0)
A
1

At C:\Documents and Settings\userfoo.android there are some android-related files which uninstaller doesn't delete. Although the most of them are used by AVD, and not by ADB, I recommend you to delete it before any "new fresh" install.

Please check your user rights and privileges, and the user "system" privileges, because of in some companies, they are cutted-off to prevent from virus or automated attacks.

Agace answered 3/4, 2013 at 15:43 Comment(7)
So I did delete that folder. I also did the install in winXP compatibilty mode. I changed in android.bat: for /f %%a in ('%java_exe% -jar C:\adt-bundle-windows-x86_64-20130219\sdk\tools\lib\archquery.jar') do set swt_path=lib\%%a to make sure the path is correct. And after restart, adb is able to start. So happy. Then I runned adb forward tcp:9222 localabstract:chrome_devtools_remote and went to localhost:9222. I am getting a "Error 324 (net::ERR_EMPTY_RESPONSE)" ... (Both the tablet general settings and the tablet chrome have the enable usb setting set...)Estriol
At this point, you should install the specific driver of your driver, and not the windows driver. I'va had to install an specific driver for Samsung Galaxy, HTC, and Acer Drivers, each different driver, and I haven't had for NexusAgace
Ok I tried with Samsung galaxy and installed the latest driver. error 324 again. Then I tried with Nexus and same result. I noticed that in the device manager, the nexus appears twice. As mobile device, and as "other device" and is marked there with the yellow exclamation mark signaling an issue.Estriol
With the Galaxy I had to install the "kies" software, appart of driver. I'm sure than for Acer tablets I ned to put the usb connection in "Camera Mode", not in Massive storage, I think that in Samsung it's the same. In Both cases, "Camera mode" and "Massive Storage mode", the computer detects your tablet, but it uses a different driver, so, one of them interacts with ADB and the other don't.Agace
please, first try with the different USB profiles. kies is the samsung's iTunes and it justs slows tour computer without any valuable functionality... but it installs TVE correct driver...Agace
small progress, I see the samsung tablet under 'adb devices', listed as C4F124C1A39363F. Then I run "adb forward tcp:9222 localabstract:chrome_devtools_remote". Having ADB_TRACE=1, it gives me logs, and sasy "OKAY" everywhere, but localhost:9222 is still unreachable.Estriol
Thank you very much for your help Ger Soto, I got it running with kies + install under sysadmin session.Estriol
W
1

The output can be pinned down to transport code:

D("readx: fd=%d wanted=%d\n", fd, (int)len);

while(len > 0) {
    r = adb_read(fd, p, len);
    if(r > 0) {
        len -= r;
        p += r;
    } else {
        if (r < 0) {
            D("readx: fd=%d error %d: %s\n", fd, errno, strerror(errno));
            if (errno == EINTR)
                continue;
        } else {
            D("readx: fd=%d disconnected\n", fd);
        }
        return -1;
    }

this might mean adb_read() returns 0 (EOF), while transport tries to read next 4. So, looks like the transport is not being able to read anything but EOF, and simply disconnects. This maybe a USB Driver issue.

Try using Linux, or running commands with root/admin privilege.

Wiredraw answered 5/4, 2013 at 17:32 Comment(2)
I did run the command as local admin. Yes I will also try with a macBook, I need that anyway to debug on iOS/safari, but it is disappointing if I cant get it to work on pc. As answer to Ger Soto, I'll look at the driver (kies), but still it is strange that it did not work with nexus as well.Estriol
Nexus uses Google Driver ... I tried lot of devices, and Nexus is the best, first, for the native adoption of android, second, because its lack of problems and third, its "first" and "always-update" expectativesAgace
S
1

Try this,

Open a command prompt with administration permission and type

netsh interface tcp set global autotuninglevel=disabled

This worked for me

Saxe answered 29/10, 2013 at 11:20 Comment(1)
thanks, but that was 7 months ago. As far as I remember, I solved it by changing device. I can't tell if your answer is right or not, but it may help somebody.Estriol
V
1

I have the same while i was running a java application 'traccar', it works for me after killing this process

Viquelia answered 31/12, 2019 at 11:4 Comment(0)
R
1

I think another process like java web server or java application like "traccar" running on your machine. It works for me after killing these process.

Regina answered 3/7, 2020 at 19:13 Comment(0)
O
0
  1. Uninstall Platform Tools in Android SDK Manager
  2. Find and delete all copies of AdbWinUsbApi.dll, AdbWinApi.dll and adb.exe
  3. Reinstall Platform Tools in Android SDK Manager
Ovipositor answered 27/3, 2013 at 17:20 Comment(3)
I tried that, but now I get "unable to start the application because AdbWinApi.dll is missing" (translated to english). I dont know if is important, but during re-installation I get "Stopping ADB server failed (code -1)"Estriol
you need to add the folder with AdbWinUsbApi.dll, AdbWinApi.dll and adb.exe to the PATH environment variableOvipositor
I will check if I did it correctly once i am back at work tomorrow. But if i did it wrong, then I think the adb.exe process wouldn't have started when used the command adb start-server. Wouldn't it ?Estriol
U
0

I can think of a couple of scenarios in which you would encounter this behavior.

  1. (most likely) You're not running adb.exe as a priviledged user. Even though you're set up as a local admin, you're not running this command with elevated privileges. Since the default run->cmd is in normal user mode, this is expected. The following article explains how to run the command prompt as an admin / priviledged user. http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/

  2. (less likely) You may need to add adb.exe to the Windows firewall rules. Go to Control Panel -> Windows Firewall, and click on "advanced settings". Then, under "inbound Rules" and "outbound rules", add a rule for adb.exe as a program.

Ursas answered 5/4, 2013 at 16:11 Comment(2)
I did right click run as admin in the msdos invite shortcut. About the firewall, I will check that. Also I have some kind of antivirus installed, it is nammed forticlient. I will have a look at that monday when I am back at work. thanks.Estriol
yes, apparently being local admin was not sufficient, I did the install under the sysadmin session, and added kies, that gave me remote debug access to the samsung tablet.Estriol
S
0

What I did was end the adb.exe on my task manager, restarted Android Studio and then I connected my device again then everything went fine :D

Sustenance answered 16/4, 2016 at 14:36 Comment(0)
N
0

adb was not responding at all for me on Windows 10. Restarting the Android device solved the problem.

Numerous answered 19/9, 2022 at 2:47 Comment(0)
A
0

This is not the answer to the OP's question, BUT on Windows adb.exe must be used alongside the Adb*.dll files it comes with. Without them being next to it, for me the commands were all returning immediately with no output and doing nothing.

Aground answered 29/5 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.