[UPDATE 26-1-2011] I had to setup my Android phone to be used for development on another machine today, but although I followed the exact same steps that I describe in the post below (which have worked in the past),this time I was still getting
List of devices attached
??????????? insufficient permissions
when running ‘adb devices’ in the terminal. The solution it seems is to run ‘adb kill-server’ and ‘adb start-server’ as root. Then my device was sucessfuly recognized. Hope this helps anyone stuck in the same situation
——————————————————————————————————————
I’ve just recently received my new HTC Desire HD (DHD) and naturally I’m gonna be doing all my development on it from now on. The first time I tried to install one of my apps using [adb] on the DHD I got the notorious permissions error [error: insufficient permissions for device]. Here’s a detailed step-by-step guide to fix this for the DHD (works with other Android devices too).
1. Plug in the device 🙂
2. fire up a terminal and type [lsusb] (without the square brackets)
You should see something like the following:
Bus 002 Device 003: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse
Bus 002 Device 002: ID 046d:c316 Logitech, Inc. HID-Compliant Keyboard
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 019: ID 0bb4:0ca2 High Tech Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Your list will be different depending on the usb devices that you have plugged in on your PC at the time. The one line that you should see and that is important here is the one that says “Hight Tech Computer Corp” aka HTC! The part we are interested in is higlhighted in red. Keep this in mind and move to the next step.
3. Create a file with your favorite editor under /etc/udev/rules.d called 51-android.rules (so you’ll have /etc/udev/rules.d/51-android.rules)
4. Add the following line in that file
SUBSYSTEM==”usb”, ATTRS{idVendor}==”0bb4“, ATTRS{idProduct}==”0ca2“, MODE=”0666″ OWNER=”username”
Notice the red highlighted parts? Those are taken from the listing that we got when we executed [lsbusb] on the terminal. For other android devices these should be filled in accordingly. Finally replace your username in the OWNER field and save the file.
5. Make sure the file is executable by typing [chmod a+rx 51-android.rules] in the terminal
6. If you have used root priviliges to create/edit the file under /etc/udev/rules.d you might need to change the owner and the group of the file to make sure that you can execute it from your normal user account. Run the following two commands in a terminal in that case
sudo chown username 51-android.rules
sudo chgrp username 51-android.rules
7. finally restart the udev service by typing [service udev restart] or [/etc/init.d/udev restart]. Will need root privileges to do that
8. run [adb devices] on the terminal to see your device name. If you see something like this
List of devices attached
HTXXXXXXXX device
then it worked!. If you see something like this
List of devices attached
??????????? insufficient permissions
then something is still wrong and you might want to re-iterate over the steps above
Hope this helped someone out there in androidsphere!
Recent Comments