Archief van de rubriek 'Android'

Using Android Debug Bridge with your N1 on Linux

12-09-2010 2010m 15:45 000000000000r door Wieland

So I recently got a Nexus One and, following these instructions, installed the Android SDK on my Linux system to be able to make screenshots and perhaps learn some Android coding.

I enabled usb debugging on the phone and fired up the Dalvik Debug Monitor. To my disappointment, my Nexus One showed up as a row of question marks, and the device was inaccessible.

Running 'adb devices' from the command line, I basically got the same result:

$ adb devices
List of devices attached
????????????    no permissions

After some Googling, here's the fix I found:

1. Create or modify the file /etc/udev/rules.d/99-android.rules to read:

SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", OWNER="user"

(where 'user' is your username). '18d1' is the N1's vendor id. It's different from HTC's (0bb4), even though HTC is the manufacturer. Some other vendor id's are listed here, but the N1 isn't mentioned.

2. Kill the adb server if it's running:

adb kill-server

3. Restart udev:

sudo restart udev

4. Restart the adb server:

adb start-server

5. On your Nexus One, make sure usb debugging is enabled (Settings -> Applications -> Development) and connect the phone to your computer.

6. Your N1 should now show up if you run 'adb devices':

$ adb devices
List of devices attached
HT061P800144	device

Instructions found elsewhere on the web may tell you to put 'MODE="0666" in the rules file created in step 1, in stead of OWNER="user". That will also work, but you'll need to start the adb server as root (sudo adb start-server).

Since it's never a good idea to run stuff as root, I prefer the solution mentioned above. The only drawback is that you'll need to specify the user that'll have access to the device. I'm fine with that, since I wouldn't want other people messing around with my phone anyway.

(I'm running Ubuntu 10.4, but these instructions should work on other distro's as well.)