Tuesday, December 06, 2011

Modifying udev on Ubuntu so that an unpriveleged user can use Android adb on a physical Android device:



sudo touch /etc/udev/rules.d/51-android.rules
sudo ln -s /lib/udev/rules.d/51-android.rules
# make sure device is NOT plugged in
lsusb | cut -d" " -f 6 | sed 's/:/ /' > ~/.tmp
# plug in the device
lsusb | cut -d" " -f 6 | sed 's/:/ /' > ~/.tmp1
diff ~/.tmp ~/.tmp1 | sed -n '/^>/s/^..\([^ ]*\) \(.*\)/SUBSYSTEM=="usb", ATTR{idVendor}=="\1",ATTR{idProduct}=="\2", GROUP="plugdev"/p' | sudo tee -a /etc/udev/rules.d/51-android.rules > /dev/null
rm -f ~/.tmp ~/.tmp1
#unplug USB device
adb kill-server
sudo service udev restart
adb start-server
# you should be good to go.
adb devices # the new device should appear

If you need to check out all permissions for all USB devices:


find /dev/bus/usb -not -type d | xargs ls -l

For Kindle Fire:


It seems that it works if you edit ~/.android/adb_usb.ini and add 2 lines containing 0x1949 and 0x0006 and restart the adb server using adb kill-server adb start-server Also, the 51-android.rules file contains the Lab126 vendor id. (thanks r1k0)

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?