[转载]Eclipse无法连接真机 并非ADB被占用 原因 很2 已解决 记录之 – Jacky_Chen-Fight – 博客园.
最近一直忙着考试的事情,然后找工作,找实习,找钱啊。对于Android我抱有很大的梦想,现实是残酷的。
OK,上面纯粹扯蛋了。今天手机连接电脑,打开USB调试,理论上就应该连接eclipse成功,可以在手机上直接测试开发中的项目。但是问题来了,怎么弄都没有反应。
什么叫怎么弄都没反应,我尝试了百度中的所有方法:
- 重启adb,无论是工具中的Reset adb,亦或是cmd中的adb kill-server然后adb start-server,eclipse的Devices中始终没有手机的身影。
- 豌豆荚占用端口、腾讯tadb占用端口等问题亦不存在,通过cmd命令 netstat -aon|findstr “5037”,查询所有占用5037的端口,adb好端端的占用着,并不存在占用的问题,所以并不是我这里的解决办法。
OK,实在不能忍了,我就去了stackoverflow,已search发现有人的情况和我是一样的。引用一下原文,我才发现自己并没有深入的去理解自己的问题所在:
I don’t want to Debug my Android apps on emulator (Android Virtual Device) anymore. Instead, I want to Debug it on my phone. My phone is LG Optimus L7 P700.
I already have downloaded USB Driver for my phone from official LG support web site. On my AVD Manager: Google USB Driver is also installed. Also, I ticked my Settings > Developer options-> USB Debugging on my phone to be enabled. I connected my phone via USB cable, but I have problem now. When I run adb devices
command on my command prompt as mentioned on tutorials I found on Google, my list of attached devices is empty, as u can see below in screenshoot. Here is screenshoot of my command prompt: http://i.imgur.com/J43CDqs.jpg
Also when I go to My Computer->Manage, my phone have yellow exclamation point, I dont know why ? Here is screenshoot: http://i.imgur.com/cfna7ds.jpg
最终我发现,原来是我的Nexus 4驱动未装好,这里我就要纳闷了,我驱动没有装好,我也可以传各种文件么。。。额,求科普。而且我的驱动无法自动搜索,迫使我从网上下载安装,然后终于在Eclipse中看到了我的手机。OH MY GOD. HOLLY SHIT!
另外这里还有一个解决办法,放在这里,算是大杀器吧,理论上可以通杀非1,2方法的问题。
这里也是引用的别人的话,凑活看吧,比较好理解,就是删了重装。
this is tricky sometimes. uninstall adb drivers through device manager and re-install them. uninstall all other adb drivers probably installed on your machine first before re-install. after installation connect your phone and choose driver-path manually. this is always the biggest pain for me with android development, I wasn`t able to connect one of my devices at all.
原因找到了,觉得自己很2.唉,有木有,专业开发20年,也会犯这种错误么。。。