Android adb “Unable to open sync connection!”

2019-01-16 02:23发布

I can run and debug my Android app on my phone just fine, most of the time. Then, seemingly randomly, when I try to run or debug my app from Eclipse, the Console in Eclipse says:

[2010-10-12 09:36:48 - myapp] Android Launch!
[2010-10-12 09:36:48 - myapp] adb is running normally.
[2010-10-12 09:36:48 - myapp] Performing com.mycompany.myapp.MyActivity activity launch
[2010-10-12 09:36:48 - myapp] Automatic Target Mode: using device 'HT01TP800561'
[2010-10-12 09:36:48 - myapp] Uploading myapp.apk onto device 'HT01TP800561'
[2010-10-12 09:36:48 - myapp] Failed to upload myapp.apk on device 'HT01TP800561'
[2010-10-12 09:36:48 - myapp] java.io.IOException: Unable to open sync connection!
[2010-10-12 09:36:48 - myapp] Launch canceled!
  • Retry: doesn't help, same messages.
  • Restart Eclipse: doesn't help.
  • Restart adb (adb kill-server && adb start-server): no errors, doesn't help.
  • Reconnect the phone: sometimes helps.
  • Reboot the computer: kind of drastic, haven't tried this yet.

Using Ubuntu 10.4, Eclipse Galileo 3.5.2, Android SDK 7, ADT plugin 0.9.6, Nexus One, Android 2.2.1.

Any bright ideas?

18条回答
beautiful°
2楼-- · 2019-01-16 02:30

This solution worked for me

  1. Click Revoke USB debugging authorizations.
  2. Click OK.
  3. Reattach USB.
  4. Click OK for Permissions.

enter image description here

查看更多
ゆ 、 Hurt°
3楼-- · 2019-01-16 02:31

As per Maven Explanation I tried this solution. but I was getting the same problem. So I restarted the device. And it started working perfectly.

查看更多
来,给爷笑一个
4楼-- · 2019-01-16 02:37

I see this problem regularly in both attached devices (Phone or Tablet) and even the emulators. I noticed that the problem often follows periods of inactivity (after a lunch break for example). It may be that the Operating System on the development machine is trying to conserve resources and adb just isn't all that JIT friendly. On windows I have to close the IDE and open Task Manager and force stop (kill) adb, then relaunch Eclipse. This always works for me...

  • I noticed if I set a higher priority in task manager for adb, this problem is greatly reduced--although it can still happen.
查看更多
Melony?
5楼-- · 2019-01-16 02:38

I was having exactly the same problem, but I already had my phone connected to the computer's USB port. Sometimes disconnecting and reconnecting the cord worked but then it stopped working completely. However, disabling USB debugging on the phone and then re-enabling it has worked so far. Hopefully it keeps working! These fixes really seem like silly hacks.. I'm not sure what the underlying problem is.

查看更多
聊天终结者
6楼-- · 2019-01-16 02:39

I was able to clear this only by cycling the USB Debugging option on the phone.

查看更多
神经病院院长
7楼-- · 2019-01-16 02:41

Nexus One here, CyanogenMod 7 (Android 2.3.7)... disable and reenable:

Settings > Applications > Development > USB debugging

And everything works now on Eclipse and Mac OS X 10.7.3.

查看更多
登录 后发表回答