Thursday, May 5, 2011

Enabling ADB (Android Debug Bridge) over USB to a Nook Color under Linux

I've replaced the stock software on my Nook Color with CyanogenMod7.  This is a modified Android 2.3 (gingerbread) image.  This has a number of advantages over the original distribution and even over the updated Barnes and Noble 2.2 distribution.  Notably it provides Bluetooth and a real Android market.

I wanted to enable ADB support so that I would be able to run applications directly from Eclipse on the Nook Color.

Before you do anything else:

  • Enable USB debugging on the device by using the Menu -> Settings -> Applications -> Development ->  USB Debugging.  If you don't do this, you won't even see the device listed under adb.  Note the vendor ID that's shown when you execute lsusb.



After doing this, I followed the instructions from http://nookdevs.com/NookColor_USB_ADB

The following command tells android that the nook color is an android device.  See the same vendor ID?

mkdir -p ~/.android && echo 0x2080 > ~/.android/adb_usb.ini && adb kill-server && adb devices
Now here's the tricky part for me....after executing adb devices, the nook color was showing as ??????? no permissions.  There were a number of workarounds for this, but I found that they were all running into similar issues.  Either they had the wrong vendor ID or they were using the wrong attribute name, or they were executing too early and were being replaced by the default udev rules.  In the end, I had to edit the udev rules as follows:


sudo vi /etc/udev/rules.d/90-android.rules
add the following text:

SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
restart udev with

sudo service udev stop && sudo service udev start
restart adb from the platform-tools directory using

./adb kill-server && ./adb start-server

when you execute adb devices again, you should see your B&N Nook Color serial number and you'll be able to debug directly from Eclipse!

No comments:

Post a Comment