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条回答
小情绪 Triste *
2楼-- · 2019-01-16 02:42

Try this,

Disabling USB debugging on the phone and then re-enabling under

Settings -> Applications -> Development -> USB debugging

its works fine.

查看更多
狗以群分
3楼-- · 2019-01-16 02:44

I fixed it just by disabling and enabling the debugging configuration on my device (SonyEricsson Xperia)

查看更多
何必那么认真
4楼-- · 2019-01-16 02:44

Restarting the phone has also fixed this problem for me whenever reseting the usb cable didnt fix it

查看更多
疯言疯语
5楼-- · 2019-01-16 02:46

This may also be related to a "too many open files" issue. I manually tried to install the app when getting the "sync" error above and that's when I got the "too many open files" clue. one brute workaround, based on some old posts, seems to be to restart the phone, and one google engineer suggested doing it twice, the second time before it goes into sleep mode the first time (details on why in the post).

That was a few years ago, and maybe they've fixed it, or just did some things to get around it in the usual cases and the reinstall-as-part-of-development is not a case that it addresses.

查看更多
Lonely孤独者°
6楼-- · 2019-01-16 02:46

When this happens on the Kindle Fire I just power it off and back on again.

查看更多
等我变得足够好
7楼-- · 2019-01-16 02:46

This error occurs when somehow the Android Debug Bridge , which is the tool to send data from our computer to the connected device, disconnects. As we know, there are some layers to get connected like the adb itself and of course, the last layer is the USB cable, so when you already tried to restart your adb script and seem not working, you just need to reconnect your cable.

查看更多
登录 后发表回答