Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Android adb works with root, but not regular user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 638
Location: San Diego, CA

PostPosted: Wed Jan 31, 2018 5:59 pm    Post subject: [Solved] Android adb works with root, but not regular user Reply with quote

I have the following setup.
Code:
# cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"


When I try adb command with the root user, everything works perfectly.
Code:
# adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
LGLS676efd4ee0f device


At this point, the adb daemon is running, so even regular users can use the adb command as well.

But if I start with a regular user, I can't proceed any further due to lack of permissions.
Code:
$ adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
LGLS676efd4ee0f no permissions

$ adb shell
error: insufficient permissions for device


I tried adding GROUP="plugdev" in "51-android.rules" and add "plugdev" group the regular user, but that didn't help either. I'd appreciate any help or suggestions.
__
sol


Last edited by solamour on Thu Feb 01, 2018 8:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18052

PostPosted: Wed Jan 31, 2018 6:32 pm    Post subject: Reply with quote

android group?
_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 638
Location: San Diego, CA

PostPosted: Thu Feb 01, 2018 12:39 am    Post subject: Reply with quote

pjp wrote:
android group?

Agreed. Looks like most Android people use Ubuntu, and although I don't believe it's gentoo specific, I threw in the question here simply because gentoo folks are the most knowledgeable bunch. Feel free to remove the post if it's irrelevant.
__
sol
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18052

PostPosted: Thu Feb 01, 2018 2:15 am    Post subject: Reply with quote

I meant add the user to the android group.

I have the android group on one of my systems, and the only reason I can imagine it is there is due to having android-studio installed.
Code:
$ adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

$ groups |grep -c android
1

_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 22046
Location: here

PostPosted: Thu Feb 01, 2018 7:11 am    Post subject: Reply with quote

pjp wrote:
I have the android group on one of my systems, and the only reason I can imagine it is there is due to having android-studio installed.

android group is created by dev-util/android-sdk-update-manager package
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 638
Location: San Diego, CA

PostPosted: Thu Feb 01, 2018 8:05 pm    Post subject: Reply with quote

I'm not entirely sure what fixed it, but as others pointed out, I suspect it was the group issue. Here is what I did.

Code:
/etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", GROUP="plugdev"

usermod -a -G plugdev REGULAR_USER'S_ID
udevadm trigger

Log out and log in again from the regular user, just for the good measure.


Curiously, one of my other machines that I recently setup doesn't have "plugdev" group, so being a lazy bum that I am, I just used "wheel" and that worked out OK as well. I also don't have "android" group either, most likely because I just downloaded the Android SDK from Google, not from Portage.

Thank you everyone for taking time to share your thoughts.
__
sol
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum