As described in Configuring ADB for Nexus 4 on Ubuntu 11.10, under Linux it is important to be listed in either ~/.android/adb_usb.ini
(user based) or /etc/udev/rules.d/51-android.rules
. Syntax for both files differs: while in the first case it's sufficient to simply add the vendor id (echo 0x18d1 >> ~/.android/adb_usb.ini
for a Nexus 4), the entry for the UDEV rule is a bit more complex. Details can be found in the linked question (or rather its answers).
Im krlmlr's case, it was not an "either-or", but seemingly both parts were needed (I never had that before, and I never even used the adb_usb.ini
-- but that doesn't mean there are no such exceptions). By adding the device in both places (which cannot hurt anyway), the device finally showed up.
Two additional remarks: After changing the UDEV rules, the UDEV service needs to be restarted to accept the changes. On Ubuntu, this can be done via sudo service udev restart
(alternatively, you can simply force UDEV to reload its rules using udevadm control --reload-rules
). If your device is still not detected, it most likely was plugged in while you did the changes; you need to disconnect and reconnect the USB cable then. Of course, USB Debugging must be enabled in your device :)
Example
by krlmlr
Based on the following output of lsusb
for the Android device in question:
Bus 002 Device 009: ID 2207:0010
it was necessary to create /etc/udev/rules.d/51-android.rules
as root
with the following contents:
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", ATTR{idProduct}=="0010", MODE="0660", GROUP="plugdev"
and to create ~/.android/adb_usb.ini
with the following contents:
0x2207
The first is required to allow regular users (that belong to the group plugdev
) to access the device. Note the permission mask 0660
instead of the frequently seen 0666
which is weaker from a point of view of security (the latter allows "world" access, while the former only allows "user and group" access). The second is required so that adb
attempts to talk to the device in the first place. After that:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
adb kill-server
and unplug+plug your Android device. Then,
adb devices
finally showed the Android device.
Remark by Izzy:
For my LG Optimus 4X HD, it was sufficient to add one line to /etc/udev/rules.d/51-android.rules
:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1004", ATTRS{idProduct}=="61a6", MODE="0666" GROUP="androiddev", SYMLINK+="android%n"
Maybe the SYMLINK
option makes the difference that I didn't need the extra entry in ~/.android/adb_usb.ini
.
adb_usb.ini
file solved the issue right away. Thanks a lot! Care to write an answer so that I can accept it?adb
usingapt-get install android-tools-adb
. No need to ever copy files or adjustPATH
settings. The package itself is tiny and contains onlyadb
and a couple of necessary files.