Saturday, November 7, 2009

[An]Droid Device and USB Driver Configuration

As I mentioned in my last post, the Eclipse Android plugin Device panel shared my view of the state of its recognition of my Droid phone when I connected via the USB cord:

???????????? no permissions

When I got up this morning, feeling a little more patient and investigative, I found these two pages which resolved this problem:

Outline of Connecting Devices via USB
Tweaking the Rules File for USB Devices and Permissions

I am running Ubuntu 8.1 64 and I was able to get a recognized device by changing my rules file (/etc/udev/rules.d/51-android.rules) to:

SUBSYSTEM=="usb|usb_device", SYSFS{22b8}=="0bb4", MODE="0660", GROUP="plugdev" SUBSYSTEM=="usb|usb_device", ATTR{22b8}=="0bb4", ATTR{idProduct}=="0c02", SYMLINK+="android_adb" SUBSYSTEM=="usb|usb_device", ATTR{22b8}=="0bb4", ATTR{idProduct}=="0c01", SYMLINK+="android_fastboot"

However, when I run ddms or Eclipse as any user other than root, I am back to the same no permissions error. I assumed that the GROUP="plugdev" bit would fix this (my own user is part of that group) but no.

So, in summary, when I run as myself, this happens:

.../android-sdk-linux/tools$ ./adb devices List of devices attached ???????????? no permissions

But then I ps -ef | grep adb, kill the adb fork-server server process and then run the same with sudo:

.../android-sdk-linux/tools$ sudo ./adb devices * daemon not running. starting it now * * daemon started successfully * List of devices attached device

Small inconvenience for now, I suppose. Until I figure this out, it is actually more convenient to use the standalone ddms (Dalvik Debug Monitor) tool (a direct analog of the Eclipse plugin but outside of Eclipse) since I can run that as root but continue running Eclipse under my own user.

---Update 4 Minutes Later---

Although the device is recognized now, it still does not report all the details one would see when attached to an emulator, such as Threads, GC etc. I can view logs and system/process details, but with all the interesting buttons greyed out, I am obviously not fully connected yet.


One thing I can do, though, is capture screen shots.


Perhaps tomorrow morning.........

2 comments:

  1. I ran into the same issues. One thing I am unclear of is what is the numbers in the filename in the /etc/udev/rules.d for? I put a 90-android.rules file. But I found some links that show 70, 71, 50, etc.

    Anyway, I had the same issue as you..the ?????? no permissions. I finally found one link that I tried and this is what I got:

    SUBSYSTEMS=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="41db", MODE="0666", OWNER="me"

    That seemed to work once I disconnected my device, shut the server down, then restarted it and connected. Now when I rund adb devices, I get the same thing you got.. a number instead of a device name. I am able to deploy an app to it now. Which is good enough for me I guess.

    I am guessing that given some time, we'll get an update somehow and it will all work.

    I am curious what the ATTRS{idProduct} is for. Whats this 41db I have there. Not sure if OWNER helps or not either.

    ReplyDelete
  2. Kevin;

    All good questions of which I can answer none. I can only identify with the "good enough for me". I would assume this is documented somewhere and when/if I find it, I will surely post something.

    //Nicholas

    ReplyDelete