Reputation: 1798
I am currently using RHEL 5 and need to connect my Nexus 4 to my PC with USB debugging enabled (done) so that I can run my android projects directly on the phone rather than the emulator which is very slow and painfully time consuming. I have updated my Android SDK manager and noticed that I did not find any Google USB drivers as those available in Windows. Some more Googling and I came across some steps to be followed to accomplish this in Ubuntu:
1. sudo lsusb
2. get the two hex values sepearetd by a ':'(This is the manufacturerID:deviceID you need to tell the system to handle)
3. Then as root, do the following:
sudo su -
cd /etc/udev/rules.d
vi 51-android.rules
In this file, add a line that enables you to handle your device. Problem is: I do not have this file in my rules.d folder. So what is the procedure for making my device recognizable in any other linux distro (in my case RHEL 5).
Also, when I do this :
adb devices
output:
List of devices attached
???????????? no permissions
Please Help. Thanks in Advance :)
Upvotes: 0
Views: 2325
Reputation: 2585
I've run into this problem too, when using RHEL/CentOS 6.6, where no plugdev
group is present.
I run adb
with unprivileged user account myuser
.
My solution was to create the /etc/udev/rules.d/50-android.rules
file with the rules:
# udev rules for USB android devices
# samsung: 04e8
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="myuser"
# LG: 1004
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="myuser"
After which I did (as root):
udevadm control --reload-rules ; udevadm trigger
and then, as myuser
:
adb kill-server
adb devices -l
The explanation: the GROUP=
option in the udev rules file specifies the group which will own the device when plugged in. In Debian-based distributions there is a plugdev
group which fulfills this purpose, but some newer RHEL-based distros don't have it. This creates a permissions problem when adb
is run with a regular (non-root) user, since it won't have access to the devices.
The solution is to assign the USB devices to a group which exists, and to which your linux user belongs. In my case I chose to assign the device to my user's "personal" group, to which it has the proper permissions.
Another solution (untested, but should work the same) would be to create the plugdev
group and add your user to it.
Upvotes: 1
Reputation: 5684
You can change the permissions of adb executable to be able to access usb. Try first, if adb works properly, when using it with root permission:
sudo ./adb kill-server
sudo ./adb start-server
sudo ./adb devices
If you do not have 'sudo' installed on your system, just do the operations above with the root user. If it works, you can use the following workaround to make it work permanently:
chown root:user_group adb
chmod 4550 adb
After this it should work.
Upvotes: 1
Reputation: 2057
You'll have to create the file from scratch and insert the line, otherwise it won't work.
Follow the instructions that you have found and you are safe.
The adb devices will show your device properly if you follow the steps.
Upvotes: 1