当试图启动或停止服务器ADB挂起 [英] adb hangs when trying to start or stop server

查看:295
本文介绍了当试图启动或停止服务器ADB挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这个问题确实是关系到亚行没有启动(没有错误信息)但目前还没有明确的解释是什么固定的问题,并重新安装一遍又一遍没有说服我。)

(This question definitely is related to ADB is not starting (no error message) but there is no clear explanation what fixed the issue and reinstalling over and over again doesn't convince me.)

当我跑我平时

$ sudo adb kill-server && sudo  adb start-server

我要CTRL-C吧。

I have to CTRL-C it.

建议adb_trace ALA其他问题得到这样的:

the suggested adb_trace álà the other question yields this:

# export ADB_TRACE=all
# 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/transport.c::writex():writex: fd=3 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=3 len=12: 686f73743a76657273696f6e host:version
system/core/adb/transport.c::readx():readx: fd=3 wanted=4 <---- freezes here

strace是稍微详细,我得到这样的:

strace is slightly more verbose and I get this:

# strace /home/leo/Downloads/android-sdk-linux/platform-tools/adb start-server
... many
... many
... lines
futex(0xffab8474, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, f742a700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0xf77525f0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xf7752680, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=-4286578688, rlim_max=-9223372032703125888}) = 0
uname({sys="Linux", node="donleo", ...}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(5037), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
write(3, "000c", 4)                     = 4
write(3, "host:version", 12)            = 12
read(3, <---- freezes here

那么,接下来呢?

So, what next?

另一种看法试图解决这一问题,当是更新通过SDK管理器的SDK失败。它告诉我,我有Android的SDK平台工具16.0.2,并希望升级到17,点击安装只是挂永远不会做任何事情。我认为这两个操作无限期等待来自同一组件的答案。 [更新:] 删除组件工作。安装现在显示的问题(与更新并没有显示在日志中的任何红线)说,亚洲开发银行停止不工作。杀亚行更新后经历了,但亚行仍拒绝工作。

Another observation when trying to fix this issue was that updating the sdk via the sdk manager failed. It tells me that I have Android SDK Platform-tools 16.0.2 and wants to update to 17. Clicking install just hangs forever without doing anything. I assume that both actions indefinitely wait for an answer from the same component. [Update: ] Deleting the component worked. Installing it now showed an issue (in contrast to update which did not show any "red" line in the log) saying that stopping adb does not worked. After killing the adb the update went through but adb still refuses to work.

更新:的怀疑,我安装的亚行本身可能被打破的,可以排除我猜。我使用的SDK的手动下载,只是试图从Ubuntu库(4.2.2 + git20130218-3ubuntu1)亚洲开发银行,这挂在完全相同的位置。

Update: The suspicion that my installation of adb itself might be broken can be ruled out I guess. I'm using the manual download of the SDK and just tried the adb from the ubuntu repository (4.2.2+git20130218-3ubuntu1) and this hangs at exactly the same spot.

推荐答案

发现了它。 在上一个 bug报告非常教育性评论的风格:

Found it. In the style of the very educative comment on a bug report:

~# adb devices
adb.c::main():Handling commandline()
adb_client.c::adb_query():adb_query: host:devices
adb_client.c::_adb_connect():_adb_connect: host:version
transport.c::writex():writex: fd=3 len=4: 30303063 000c
transport.c::writex():writex: fd=3 len=12: 686f73743a76657273696f6e host:version
transport.c::readx():readx: fd=3 wanted=4
^Z          
[1]+  Stopped                 adb devices

嗯......文件描述符3?

Hmm... file descriptor 3?

# pgrep adb
5982
# ls -l /proc/5982/fd/
total 0
lrwx------ 1 root root 64 Jun 14 18:04 0 -> /dev/pts/0
lrwx------ 1 root root 64 Jun 14 18:04 1 -> /dev/pts/0
lrwx------ 1 root root 64 Jun 14 18:04 2 -> /dev/pts/0
lrwx------ 1 root root 64 Jun 14 18:04 3 -> socket:[96863]

插座96863?

socket 96863?

# lsof | grep 96863
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/leo/gvfs
      Output information may be incomplete.

adb       5982            root    3u     IPv4              96863       0t0        TCP localhost:55463->localhost:5037 (ESTABLISHED)
# netstat -antp | grep LISTEN | grep 5037
tcp6       0      0 :::5037                 :::*                    LISTEN      2419/java       

AVA? Java的是什么?

ava? java what?

# ps -Alf | grep java
1 S root      2409     1  0  80   0 -  4620 hrtime 16:20 ?        00:00:07 /opt/traccar/bin/./wrapper /opt/traccar/bin/../conf/wrapper.conf wrapper.syslog.ident=traccar wrapper.pidfile=/opt/traccar/bin/./traccar.pid wrapper.name=traccar wrapper.displayname=traccar wrapper.daemonize=TRUE wrapper.statusfile=/opt/traccar/bin/./traccar.status wrapper.java.statusfile=/opt/traccar/bin/./traccar.java.status wrapper.script.version=3.5.19
0 S root      2419  2409  0  80   0 - 810286 futex_ 16:20 ?       00:00:41 /usr/lib/jvm/java-6-oracle/jre/bin/java -Djava.library.path=../lib -classpath ../lib/wrapper.jar:../tracker-server.jar -Dwrapper.key=ja2Mz5xiI18XmG4C -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.disable_console_input=TRUE -Dwrapper.pid=2409 -Dwrapper.version=3.5.19 -Dwrapper.native_library=wrapper -Dwrapper.arch=x86 -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.traccar.Main /opt/traccar/conf/traccar.cfg
0 S leo       3549  3421  2  80   0 - 853194 futex_ 16:24 ?       00:02:59 /usr/bin/java -Xms40m -Xmx512m -XX:MaxPermSize=256m -jar /home/leo/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -os linux -ws gtk -arch x86_64 -showsplash /home/leo/Downloads/eclipse//plugins/org.eclipse.platform_4.2.2.v201302041200/splash.bmp -launcher /home/leo/Downloads/eclipse/eclipse -name Eclipse --launcher.library /home/leo/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807/eclipse_1502.so -startup /home/leo/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.overrideVmargs -exitdata 148007 -vm /usr/bin/java -vmargs -Xms40m -Xmx512m -XX:MaxPermSize=256m -jar /home/leo/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
0 S root      6280  4662  0  80   0 -  2360 pipe_w 18:24 pts/0    00:00:00 grep --color=auto java

grrrrr!为什么?为什么?为什么会出现在亚行没有超时什么的?为什么traccar - 一个软件,还具有Android客户端 - 使用亚行的端口5037为它IntelliTrac组成部分?他们使用的所有端口5000通过5040。

grrrrr! Why? Why? Why is there no timeout or something in adb? Why does traccar – a software that also has an Android client – use ADB's port 5037 for its IntelliTrac component? They use all ports 5000 through 5040.

# /etc/init.d/traccar stop
Stopping traccar...
Stopped traccar.
# adb start-server
# adb devices

List of devices attached 
016814F11001F009    device

这篇关于当试图启动或停止服务器ADB挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆