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

107,386

Solution 1

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 =)

Solution 2

I had the same problem and solved it by just change the owner of adb to root and restart then in future the problem won't happen again.

use this:

    sudo chown root:root -R /opt/..../sdk/platform-tools/*
    sudo /opt/..../sdk/platform-tools/adb kill-server 
    sudo /opt/..../sdk/platform-tools/adb start-server
Share:
107,386

Related videos on Youtube

Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    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?

    • Diego Torres Milano
      Diego Torres Milano about 11 years
      Did you change adb version? It might be the problem.
    • Admin
      Admin almost 11 years
      No, I didn't. I have the latest version of adb and is the same I used in the previous Ubuntu version.
  • Rojesh
    Rojesh over 10 years
    On execution of the command "sudo adb kill-server", m getting command not found.
  • Stan Kurdziel
    Stan Kurdziel over 10 years
    @Rojesh make sure you have the directory containing adb on your path. Ex: export PATH=$PATH:/opt/android-sdk-linux/platform-tools
  • An SO User
    An SO User almost 9 years
    @Rojesh exclude the sudo.