15

I am unable to connect to my phone using adb. I am getting the following error:

D:\softwares\Development\Android\android-sdk-windows\platform-tools>adb devices -l
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: protocol fault (couldn't read status): Invalid argument

http://s18.postimg.org/7fdc8w9dl/screenshot_97.png

Previously i am getting this error in windows 8.1 then i have installed windows 10 and error resolved but now again i am unable to connect my cellphone with adb :(.

I am getting this error even if no device is connected.

Eclipse error:

[2015-10-24 13:25:02 - ddms] Failed to initialize Monitor Thread: Unable to establish loopback connection
[2015-10-24 13:25:02 - adb] error: protocol fault (couldn't read status): Invalid argument
[2015-10-24 13:25:02 - ddms] 'D:\softwares\Development\Android\android-sdk-windows\platform-tools\adb.exe,start-server' failed -- run manually if necessary

Update: Even adb tcp is also not working so i think this is not a driver issue.

ADB traces http://s24.postimg.org/mtfdwf3id/screenshot_99.png

H4SN
  • 1,482
  • 3
  • 24
  • 43

14 Answers14

7

In my case:

adb kill-server
adb start-server

:)

  • 3
    This doesn't always work, it sometimes gives out a "error: failed to read response from server" if such think happens, rebooting is required. – Chepech Feb 24 '22 at 00:52
6

Although not exactly the same error as the OP, I was getting a similar error in Windows:

❯ adb.exe start-server
error: protocol fault (couldn't read status): No error

This error was related to my port proxy. It seems I had setup some rules that resulted in the adb client/server not being able to communicate with each other.

I was able to solve this by resetting my portproxy settings:

netsh interface portproxy reset

And now I can start the adb server:

❯ adb.exe start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
badsyntax
  • 9,394
  • 3
  • 49
  • 67
5

Just Restart PC and everything mean Android Studio and your android Device its working for me

Muhammad Natiq
  • 213
  • 5
  • 14
5

None of mentioned solutions work, seems like something wrong with windows, finally i ended up with resetting my windows 10 and issue resolved.

H4SN
  • 1,482
  • 3
  • 24
  • 43
3

As you may found in source code of ADB, something raised up this error:

     if (!ReadFdExactly(fd, buf, 4)) {
         *error = perror_str("protocol fault (couldn't read status)");
         return false;
     }

Try to export export ADB_TRACE=all

And rerun adb devices

With this env variable you will see much more info

Laser
  • 6,652
  • 8
  • 54
  • 85
3

I was also getting this error so here's how I solved it. I killed the adb process and start again.

Steps:

  1. Open the Task manager (Windows);
    • You can press Ctrl+Shift+Esc and task manager will be opened.
  2. Find adb.exe and right click on it. Click the "End process" menu item;
  3. Open a command prompt and type adb start-server and it will start the adb again.
Sampat Sharma
  • 71
  • 1
  • 3
  • Excelente, funcionó de maravilla, nada de reiniciar PC, Gracias – Adonys Jan 05 '22 at 15:23
  • This is not a solution, even if it might work in some cases. It does not fix the cause why the issue occurs in the first place. It is just a simple retry. – arkascha Jan 28 '22 at 13:20
  • IT IS a solution because explain why this is happening . Another adb process is running in zombie mode and needs to be killed – Delcasda May 12 '22 at 18:52
2

In your task manager, find adb.exe > right click and End Process.

solved this way for me..

Mustafa Al Ajmi
  • 63
  • 1
  • 1
  • 5
1

See my answer here, for me adb port 5037 was in use, killing the process using the port resolve the issue.

piouson
  • 3,328
  • 3
  • 29
  • 29
0

You can get more info with:

export ADB_TRACE=all

This gave me the full log when connecting:

adb D 12-15 11:48:11  1014 18521 adb_trace.cpp:187] Android Debug Bridge version 1.0.41
adb D 12-15 11:48:11  1014 18521 adb_trace.cpp:187] Version 30.0.2-6538114
adb D 12-15 11:48:11  1013 18519 adb_client.cpp:155] _adb_connect: host:connect:192.168.1.109
adb D 12-15 11:48:11  1013 18519 adb_io.cpp:107] writex: fd=3 len=30 30303161686f73743a636f6e6e656374 001ahost:connect [truncated]
adb D 12-15 11:48:11  1013 18519 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 12-15 11:48:11  1013 18519 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 4f4b4159 OKAY
adb D 12-15 11:48:11  1013 18519 adb_client.cpp:189] _adb_connect: return fd 3
adb D 12-15 11:48:11  1013 18519 adb_client.cpp:364] adb_connect: return fd 3
adb D 12-15 11:48:11  1013 18519 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 12-15 11:48:11  1013 18519 adb_io.cpp:91] readx: fd=3 disconnected
error: protocol fault (couldn't read status length): Undefined error: 0

I resolved the issue by updating my Platform Tools from the SDK Manager in Android Studio.

$ adb --version
Android Debug Bridge version 1.0.41
Version 30.0.5-6877874
Bert Wijnants
  • 385
  • 2
  • 5
0

Uninstall and re-install ADB from Android Studio and check your path to make sure you aren't pointing to any other ADB installations.

I had no other installations but for some reason the ADB instance I had was corrupted (v 1.0.41).

I went to Preferences >> Android SDK >> Unchecked the installed version >> Clicked next to uninstall.

Then I went back and re-checked the box to install it again and it worked. Still version 1.0.41

tricknology
  • 1,092
  • 1
  • 15
  • 27
0

I had a similar issue after updating android studio.

None of the above solutions are worked.

https://developer.android.com/studio/releases/platform-tools

I solved it by downloading platform-tools from the above link. And replaced the contents of my android SDK's platform-tools with downloaded one

Muhamed Riyas M
  • 5,055
  • 3
  • 30
  • 31
0

If ADB is not recognized

If you can't get your 'adb' to recognize in Windows follow this guide to edit your path variables. Scroll to answer by Linh.

'adb' is not recognized as an internal or external command, operable program or batch file

Then follow above. And restart Android studio after the process is done. That worked for me.

0

Just find where the adb is installed, just change the name of adb to something else and try again with adb devices. It will work

Aakash V
  • 43
  • 7
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 02 '23 at 21:49
0

If you're getting this error:

rhradec@server.local ~/android/platform-tools $ ADB_TRACE=all ./adb devices
adb D 06-09 13:25:17 1229295 1229295 adb_trace.cpp:187] Android Debug Bridge version 1.0.41
adb D 06-09 13:25:17 1229295 1229295 adb_trace.cpp:187] Version 34.0.3-10161052
adb D 06-09 13:25:17 1229295 1229295 adb_trace.cpp:187] Installed as /RAID/atomo/home/rhradec/android/platform-tools/adb
adb D 06-09 13:25:17 1229295 1229295 adb_trace.cpp:187] Running on Linux 5.9.14-zen1-1-zen (x86_64)
adb D 06-09 13:25:17 1229295 1229295 adb_trace.cpp:187] 
adb D 06-09 13:25:17 1229295 1229295 adb_client.cpp:160] _adb_connect: host:version
adb D 06-09 13:25:17 1229295 1229295 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a76657273696f6e 000chost:version
adb D 06-09 13:25:17 1229295 1229295 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-09 13:25:17 1229295 1229295 adb_io.cpp:88] readx: fd=3 error 104: Connection reset by peer
adb: failed to check server version: protocol fault (couldn't read status): Connection reset by peer

It means the default port for adb server is being allocated for a process that is not responding.

That would probably be another adb server frozen and hanging around, but if you have no adb process running and you don't know what's locked port 5037, a quick workaround is to use adb with a different port, like:

adb -P 5038 devices

in my case, this worked perfectly for the Connection reset by peer error I was getting.

Roberto Hradec
  • 131
  • 1
  • 5