no permissions (user in plugdev group; are your udev rules wrong?)

If you are trying to access your android devices shell using adb on a new ubuntu machine, there are higher chances that your may seen an error like below,

 

1

2

3

4

5

$ adb devices

List of devices attached

* daemon not running; starting now at tcp:5037

* daemon started successfully

B2NGAA8831702707    no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]

 

OR

 

1

2

error: insufficient permissions for device: user in plugdev group; are your udev rules wrong?

See [http://developer.android.com/tools/device.html] for more information

 

This error is because, your Ubuntu machine user is not able to access adb shell due to some permission restrictions. As we have observed, there are 3 possible solutions for resolving this issue, either one of these should work for you.

Solution 1

In our case, if we use with sudo permissions i.e. “sudo adb devices” was working fine and we could access adb, but we were getting above errors with normal user. In our case, rest of 2 solutions didn’t worked because “our mobile was connected to laptop in “USB Tethering Mode” from Hotspot and Tethering settings options

 

Till you access adb shell, switch USB to “File Transfer” mode

 

and try again, as,

 

$ adb kill-server

$ adb devices

Solution 2

As mentioned in https://developer.android.com/studio/run/device Make sure that you are in the plugdev group. Add your user to playdev group as below,

$ sudo usermod -aG plugdev $LOGNAME

$ adb kill-server

$ adb devices

 

 

 

Solution 3

Know the USB Vendor Id and Product Id of your android device using lsusb command as,

$ lsusb

Bus 001 Device 019: ID 2e04:c008

As seen above, For Our mobile idVendor is 2e04 and idProduct is c008, add this details to udev rule as, [ Replace idVendor and idProduct as per your device ]

$ sudo vim /etc/udev/rules.d/51-android.rules

 

1

SUBSYSTEM=="usb", ATTR{idVendor}=="2e04", ATTR{idProduct}=="c008", MODE="0666", GROUP="plugdev"

 

$ sudo udevadm control --reload-rules

$ adb kill-server

$ adb devices

 

 

 

 

https://www.lynxbee.com/solved-no-permissions-user-in-plugdev-group-are-your-udev-rules-wrong/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值