简体   繁体   English

带有Android Studio的Ubuntu上的Android USB调试异常

[英]Android USB Debugging on Ubuntu with Android Studio is flaky

The ADB can see my device via USB. ADB可以通过USB查看我的设备。 Sometimes I'm able to deploy to my USB device, but many times I'm not. 有时我可以部署到我的USB设备,但很多时候却无法。 Android Studio attempts to copy the file to my phone, and most times it just hangs there: Android Studio尝试将文件复制到我的手机上,大多数情况下它只是挂在这里:

Waiting for device. 
enter code hereTarget device: samsung-sch_i535-6a0c34e3
Uploading file
    local path: /home/shane/AndroidStudioProjects/Test1/app/build/outputs/apk/app-debug.apk
    remote path: /data/local/tmp/com.example.shane.test1

Does anybody have a solution that I can try? 有人有我可以尝试的解决方案吗?

Thanks 谢谢

I don't have any issues on Ubuntu 14.04, works pretty much always without problems. 我在Ubuntu 14.04上没有任何问题,几乎总是可以正常工作。

However I had similar issues on different machines (on OSX) 但是我在不同的机器上(在OSX上)也遇到了类似的问题

Does adb devices show your phone as connected? adb devices是否将您的手机显示为已连接?

  • If yes, then it's probably rather AS to blame. 如果是的话,那也许应该归咎于AS。 Make sure you are on the latest version (1.0.1 at the time of writing). 确保您使用的是最新版本(在撰写本文时为1.0.1)。
  • If no, try adb kill-server and see if that changes things. 如果否,请尝试使用adb kill-server并查看是否可以更改。 Also adb has debug flag ADB_TRACE that you can set, this should give you much more information. 另外, adb具有可设置的调试标志ADB_TRACE ,这ADB_TRACE您提供更多信息。

As a side note - make sure your cable is okay. 附带说明-确保电缆没有问题。 I once spent days 'debugging' adb just to find out that the cable had a loose contact. 我曾经花了几天的时间“调试” adb只是发现电缆接触不良。

And, last but not least, try connection over Wifi and see if you have similar issues. 最后但并非最不重要的一点是,尝试通过Wifi进行连接,看看是否存在类似问题。

Happy debugging. 调试愉快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM