(这个问题肯定与ADB is not starting (no error message)有关,但没有明确的解释是什么解决了这个问题并重新安装并不能说服我。)
当我按照惯例运行时
$ sudo adb kill-server && sudo adb start-server
我必须CTRL-C它。
建议的adb_traceálà另一个问题产生了这个:
# 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 /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
那么,下一步是什么?
另一个观察在尝试解决此问题时,通过sdk管理器更新sdk失败了。它告诉我,我有Android SDK平台工具16.0.2,并希望更新到17.单击安装只是永远挂起而不做任何事情。我假设这两个动作无限期地等待来自同一组件的答案。 [更新:] 删除组件工作正常。现在安装它显示了一个问题(与日志中没有显示任何“红色”行的更新相反)说停止adb不起作用。在杀死adb之后,更新已经完成,但adb仍然拒绝工作。
更新:我猜测可以排除怀疑我的adb本身安装可能会被破坏。我正在使用SDK的手动下载,只是尝试了ubuntu存储库中的adb(4.2.2 + git20130218-3ubuntu1),而且它挂在完全相同的位置。
答案 0 :(得分:17)
找到它。 以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?
# 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]
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是什么?
# 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!为什么?为什么? adb为什么没有超时或什么?为什么traccar(一个也有Android客户端的软件)使用ADB的端口5037作为其IntelliTrac组件?他们使用所有端口5000到5040。
# /etc/init.d/traccar stop
Stopping traccar...
Stopped traccar.
# adb start-server
# adb devices
List of devices attached
016814F11001F009 device
答案 1 :(得分:4)
感谢您的解决方案。
但我试图杀死adb进程,我可以重新启动adb进程。
1)找到adb的PID
#pgrep adb
23038
2)杀死adb进程
#kill -9 23038
3)列出设备
#adb devices
答案 2 :(得分:0)
AndyOS(Android Emulator)也与ADB发生冲突。杀死了Andy服务,adb又开始工作了。
答案 3 :(得分:0)
根据giszmo的回答,我的adb
被阻止了,但是没有被其他程序阻止,而是被connect
用于IPv6套接字[永远不会绑定]。
ipv6.disable_ipv6=1
我的内核解决了这个问题,但可能不是一个永久的解决方案。