ADB server does not support, is already tied to tcp: 5037 (after kill & restart)

I installed android studio on my arch-linux installation. I am new to Android development, so this was a research process.

The problem I am facing is that I cannot start the AVD emulator. Looking at the log on stdout, I get an error:

[  37311]   WARN -            #com.android.ddmlib - error: could not install *smartsocket* listener: Address already in use 
[  37339]   WARN -            #com.android.ddmlib - '/home/parma/Android/Sdk/platform-tools/adb start-server' failed -- run manually if necessary 
[  37341]   WARN -            #com.android.ddmlib - ADB server didn't ACK 
[  37341]   WARN -            #com.android.ddmlib - * failed to start daemon * 
[  37341]   WARN -            #com.android.ddmlib - error: cannot connect to daemon 

Now, when I start it manually at this moment, I get the same answer.

I check what is connected with this port

$ ss -lpn | grep 5037
tcp    LISTEN     0      4      127.0.0.1:5037                  *:*                   users:(("adb",pid=22346,fd=7))

$ ps -aux | grep adb                                     
parma    22346  0.0  0.0 167428  1932 ?        Ssl  11:04   0:00 adb -L tcp:5037 fork-server server --reply-fd 4
parma    22668  0.0  0.0  10788  2216 pts/0    R+   11:13   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn adb

Adb will appear.

First I try:

$ adb kill-server 
* server not running *

And so I decided to just kill the process.

$ kill 22346
$ ps -aux | grep adb                                    
parma    23612  0.0  0.0  10788  2088 pts/0    S+   11:32   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn adb
$ ss -lpn | grep 5037  

Two different things come from here, depending on whether I try to manually start the ADB server or try to start it by running the AVD emulator from the IDE.

I run it manually:

$ adb start-server
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
$ ss -lpn | grep 5037                                    
tcp    LISTEN     0      4      127.0.0.1:5037                  *:*                   users:(("adb",pid=23685,fd=6))

AVD, , .

, AVD , adb, 5037

, . IDE , , , .

, , , , , :

$ ps -faux
...
parma     8953  0.0  0.4 603036 38756 ?        Rsl  Apr04   0:25  \_ /usr/lib/gnome-terminal/gnome-terminal-server
parma     8959  0.0  0.0  43612  6140 pts/0    Ss   Apr04   0:00  |   \_ zsh
parma    24021  0.0  0.0  41988  4336 pts/0    R+   11:45   0:00  |   |   \_ ps -faux
parma     9375  0.0  0.0  43480  5956 pts/1    Ss   Apr04   0:00  |   \_ zsh
parma    10915  0.0  0.0  13716  3116 pts/1    S+   Apr04   0:00  |       \_ /bin/sh /usr/bin/android-studio
parma    10967  0.2  9.4 5183808 763400 pts/1  Sl+  Apr04   2:40  |           \_ /home/android-studio/bin/../jre/bin/java -Xbootclasspath/a:/home/android-studio/bin/../lib/boot.jar -classpath 
parma    10994  0.0  0.0   5180  2204 pts/1    S+   Apr04   0:00  |               \_ /home/android-studio/bin/fsnotifier64
parma    23842  0.0  0.0 167700  3768 ?        Ssl  11:42   0:00  \_ adb -L tcp:5037 fork-server server --reply-fd 4
...

, Android- , - . , , " adb ... ADB- ACK"

, . , - .

genymotion ( , ) - .

, , , SDK.

, , , , , , .

, 5037:

$ adb devices
List of devices attached
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
** daemon still not running
error: cannot connect to daemon at tcp:5037: Connection refused

, , .

+4

Source: https://habr.com/ru/post/1674082/


All Articles