Search code examples
androideclipseubuntuadb

Must do adb kill-server and start-server everytime to recognize android device in Ubuntu


I'm developing android apps in eclipse and I upgraded recently from Ubuntu 12.10 (Quantal Quetzal) to Ubuntu 13.04 (Raring Ringtail). In the previous Ubuntu version I had zero problems in recognizing my android device.In this new Ubuntu version I must do:

sudo adb kill-server

and

sudo adb start-server

in order to Ubuntu recognize my android device. Everytime I restart my computer it appears question marks in eclipse when I try to debug an app, and I have to run these command lines everytime to make it work.

Anyone knows if there is a way to recognize my phone permantelly?


Solution

  • adb "flakiness" is a common problem, you have the right idea to start adb with root permissions. If you have eclipse running and run it as two separate commands, there is a chance that eclipse will have tried to startup adb as a non-root user before you have run your start-server, so I recommend running in a single command line:

    sudo adb kill-server && sudo adb start-server
    

    Also you want to make sure you have only one copy of the sdk installed and that eclipse is using the same copy as is on your path at the command line.

    Possibly could throw the run-as-root logic into an init script so that when you restart the computer it comes up as root - I haven't tried this though, always just "control-r, start-ser" from the command line =)