Must do adb kill-server and start-server everytime

2019-02-16 13:07发布

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?

2条回答
孤傲高冷的网名
2楼-- · 2019-02-16 13:25

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

查看更多
男人必须洒脱
3楼-- · 2019-02-16 13:36

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
查看更多
登录 后发表回答