Adb keeps restarting with error 'Adb connection Error:EOF'
Asked Answered
L

2

9

Adb repeatedly keeps restarting with the following error trace:

Adb connection Error:EOF
Cannot reach ADB server, attempting to reconnect
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb restarted
ADB connection re-established after 11 seconds.
Adb connection Error:EOF .

I am not running any emulator and no phone is connected. Removed Android studio completely and reinstalled. Still no luck.

AndroidStudio Version: Bumblebee | 2021.1.1 Patch 1 (February 1, 2022)
Android Emulator Version: 31.2.8
Operating System: Ubuntu 20.04

idea.log excerpt is as follows:

2022-02-08 19:10:00,817 [  48452]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
2022-02-08 19:10:00,818 [  48453]   WARN -            #com.android.ddmlib - Cannot reach ADB server, attempting to reconnect. 
2022-02-08 19:10:01,289 [  48924]   INFO - roid.tools.idea.adb.AdbService - Cancelling current future since it finished with a failure 
2022-02-08 19:10:01,289 [  48924]   INFO - roid.tools.idea.adb.AdbService - Initializing adb using: /home/tahmid/Android/Sdk/platform-tools/adb 
2022-02-08 19:10:01,289 [  48924]   INFO - roid.tools.idea.adb.AdbService - Terminating ADB connection 
2022-02-08 19:10:01,292 [  48927]   INFO - roid.tools.idea.adb.AdbService - ADB connection successfully terminated 
2022-02-08 19:10:01,296 [  48931]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2022-02-08 19:10:01,373 [  49008]   WARN -            #com.android.ddmlib - * daemon started successfully 
2022-02-08 19:10:01,376 [  49011]   INFO -            #com.android.ddmlib - Connected to adb for device monitoring 
2022-02-08 19:10:01,576 [  49211]   INFO - roid.tools.idea.adb.AdbService - Successfully connected to adb 
2022-02-08 19:10:16,213 [  63848]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
2022-02-08 19:10:16,213 [  63848]   WARN -            #com.android.ddmlib - Cannot reach ADB server, attempting to reconnect. 
2022-02-08 19:10:16,402 [  64037]   INFO - roid.tools.idea.adb.AdbService - Cancelling current future since it finished with a failure 
2022-02-08 19:10:16,402 [  64037]   INFO - roid.tools.idea.adb.AdbService - Initializing adb using: /home/tahmid/Android/Sdk/platform-tools/adb 
2022-02-08 19:10:16,402 [  64037]   INFO - roid.tools.idea.adb.AdbService - Terminating ADB connection 
2022-02-08 19:10:16,408 [  64043]   INFO - roid.tools.idea.adb.AdbService - ADB connection successfully terminated 
2022-02-08 19:10:16,413 [  64048]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2022-02-08 19:10:16,484 [  64119]   WARN -            #com.android.ddmlib - * daemon started successfully 
2022-02-08 19:10:16,486 [  64121]   INFO -            #com.android.ddmlib - Connected to adb for device monitoring 
2022-02-08 19:10:16,686 [  64321]   INFO - roid.tools.idea.adb.AdbService - Successfully connected to adb 
2022-02-08 19:10:33,584 [  81219]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
2022-02-08 19:10:33,585 [  81220]   WARN -            #com.android.ddmlib - Cannot reach ADB server, attempting to reconnect. 
2022-02-08 19:10:43,599 [  91234]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2022-02-08 19:10:43,675 [  91310]   WARN -            #com.android.ddmlib - * daemon started successfully 
2022-02-08 19:10:43,677 [  91312]   INFO -            #com.android.ddmlib - adb restarted 
2022-02-08 19:10:44,677 [  92312]   INFO -            #com.android.ddmlib - ADB connection re-established after 11 seconds. 
2022-02-08 19:10:50,202 [  97837]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
2022-02-08 19:10:50,203 [  97838]   INFO -            #com.android.ddmlib - Connected to adb for device monitoring 
2022-02-08 19:10:50,226 [  97861]   WARN -            #com.android.ddmlib - Sending Tracking request failed! 
2022-02-08 19:10:50,227 [  97862]   WARN -            #com.android.ddmlib - Adb connection Error:Connection reset by peer 
2022-02-08 19:10:50,227 [  97862]   WARN -            #com.android.ddmlib - Cannot reach ADB server, attempting to reconnect. 
2022-02-08 19:11:00,242 [ 107877]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2022-02-08 19:11:00,316 [ 107951]   WARN -            #com.android.ddmlib - * daemon started successfully 
2022-02-08 19:11:00,318 [ 107953]   INFO -            #com.android.ddmlib - adb restarted 
2022-02-08 19:11:01,318 [ 108953]   INFO -            #com.android.ddmlib - ADB connection re-established after 11 seconds. 
2022-02-08 19:11:05,933 [ 113568]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
2022-02-08 19:11:05,934 [ 113569]   WARN -            #com.android.ddmlib - Cannot reach ADB server, attempting to reconnect. 
2022-02-08 19:11:11,091 [ 118726]   INFO - roid.tools.idea.adb.AdbService - Cancelling current future since it finished with a failure 
2022-02-08 19:11:11,091 [ 118726]   INFO - roid.tools.idea.adb.AdbService - Initializing adb using: /home/tahmid/Android/Sdk/platform-tools/adb 
2022-02-08 19:11:11,091 [ 118726]   INFO - roid.tools.idea.adb.AdbService - Terminating ADB connection 
2022-02-08 19:11:11,098 [ 118733]   INFO - roid.tools.idea.adb.AdbService - ADB connection successfully terminated 
2022-02-08 19:11:11,103 [ 118738]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2022-02-08 19:11:11,180 [ 118815]   WARN -            #com.android.ddmlib - * daemon started successfully 
2022-02-08 19:11:11,183 [ 118818]   INFO -            #com.android.ddmlib - Connected to adb for device monitoring 
2022-02-08 19:11:11,383 [ 119018]   INFO - roid.tools.idea.adb.AdbService - Successfully connected to adb 
2022-02-08 19:11:12,176 [ 119811]   WARN -            #com.android.ddmlib - Adb connection Error:EOF 
Lavallee answered 9/2, 2022 at 1:21 Comment(3)
Have you tried killing and restarting the adb server. pkworlz.com/how-to-quickly-restart-adb-exe This "How to" shows you were the adb.exe is and how to kill and restart the adb server from cmd.Dive
The latest adb binaries from platform-tools v32 are known to be very unstable especially on Linux and MacOS (there were quite a few questions on with similar problems the last week). I would recommend to downgrade to v31: androidsdkmanager.azurewebsites.net/PlatformtoolsScorekeeper
@Scorekeeper downgrading Android SDK Platform-tools to version 31.0.1 appears to have resolved the issue. I have also noticed the SDK Platform-tools release notes of version 32.0.0 says, **adb**: Known issue: this version crashes when run without any arguments.Lavallee
H
16

This solution helped me:

Disable mDNS for wireless debugging. This can be done in:

Android Studio > Settings > Build, Execution, Deployment > Debugger > Untick "Enable adb mDNS for wireless debugging"

Source: Error: "Adb connection Error:An existing connection was forcibly closed by the remote host"

Hirudin answered 15/3, 2022 at 10:46 Comment(0)
G
0

I had the same issue,it seemed that the IDE can't start the adb server,so I tried to start the adb daemon manually

./adb start-server

It worked with me under archlinux with adb version 31.0.3-7562133.

Granddaughter answered 11/3, 2022 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.