日期:2014-05-16 浏览次数:20743 次
关于adb命令没有权限访问手机设备的问题
在使用Ubuntu的朋友应该碰到过在执行adb相关命令的时候会提示如下的错误:
liubzh@liubzh-PC:/$ adb shell error: insufficient permissions for device
liubzh@liubzh-PC:/$ adb devices List of devices attached ???????????? no permissions
更改用户和组为root,此方法摘自此处。
转到adb所在的目录 shily@hh-desktop:~$cd ~/sdk/android-sdk_eng.sdk_linux-x86/tools shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$ls -ladb -rwxr-xr-x 1 shily shily 341694 2010-05-11 05:46 adb shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$sudo chown root:root adb [sudo] password for shily: shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$ls -ladb -rwxr-xr-x 1root root 341694 2010-05-11 05:46 adb shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$sudo chmod u+s adb shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$ls -ladb -rwsr-xr-x 1 root root 341694 2010-05-11 05:46 adb shily@hh-desktop:~/sdk/android-sdk_eng.sdk_linux-x86/tools$
So you probably need to do “adb start-server” as root first: ubuntu$ sudo ./out/host/linux-x86/bin/adb kill-server ubuntu$ sudo ./out/host/linux-x86/bin/adb start-server * daemon not running. starting it now * * daemon started successfully * ubuntu$ ./out/host/linux-x86/bin/adb shell
但是,这样还是很麻烦,我们应该通过Android官方网站的方式来解决这个问题:
Set up your system to detect your device.
udev
rules file that contains a USB configuration for each type of deviceyou want to use for development. In the rule