Search code examples
androiddebuggingubuntuandroid-studioadb

Android USB Debugging on Ubuntu with Android Studio is flaky


The ADB can see my device via USB. Sometimes I'm able to deploy to my USB device, but many times I'm not. Android Studio attempts to copy the file to my phone, and most times it just hangs there:

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


Solution

  • I don't have any issues on Ubuntu 14.04, works pretty much always without problems.

    However I had similar issues on different machines (on OSX)

    Does adb devices show your phone as connected?

    • If yes, then it's probably rather AS to blame. Make sure you are on the latest version (1.0.1 at the time of writing).
    • If no, try adb kill-server and see if that changes things. Also adb has debug flag ADB_TRACE that you can set, this should give you much more information.

    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.

    And, last but not least, try connection over Wifi and see if you have similar issues.

    Happy debugging.