Skip to content

Instantly share code, notes, and snippets.

@SunRain
Created February 4, 2012 05:54
Show Gist options
  • Save SunRain/1735703 to your computer and use it in GitHub Desktop.
Save SunRain/1735703 to your computer and use it in GitHub Desktop.
adb devices显示no permissions
以普通用户登录linux,解出android-sdk后,设置环境变量,然后运行adb devices会提示权限不够:
List of devices attached
???????????? no permissions
这是因为访问adb设备需要root权限。
我们可以利用文件的set-user-id属性来解决这个问题:
sudo chown root:root adb
sudo chmod a+x adb
sudo chmod a+s adb
adb kill-server
先将adb的owner改为root、对所有用户加入可执行属性,然后设置set-user-id属性。这样,任何用户运行adb后,adb就会以owner身份运行(即root),而不是登录的用户。之后还需要adb kill-server,重新启动adb server。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment