PDA

View Full Version : [ubuntu] troble getting adb devices working in ubuntu



banana jama
May 19th, 2009, 08:52 PM
im trying to connect my g1 to ubuntu. i found a google codes forum that said to to the following:

Try creating a file called /etc/udev/rules.d/50-android.rules and
plugging the following line into it:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

Reload udev's configuration (/etc/init.d/udev reload) and try again as
a normal user.

This is on an Ubuntu 8.10 (Intrepid Ibex) installation (64-bit). Works
fine here after that change. Presumably (given the idVendor tag) this
will only work for the G1.

i went to the folder udev/rules.d and notice that the files were text files so i open text editor and enter the infomation that they said (the subsystem=="usb" stuff) and saved it as 50-android.rules in the folder destination called for and used the following code to restart udev:

sudo /etc/init.d/udev reload
which output ok. but i still can't run adb devices it says command not found and i can't see what i did wrong. can someone help?
im using 9.04 32-bit but i can't see how this would be a problem since the commands given doesn't seem version or bit type specific. any help would be appreciated.

banana jama
May 19th, 2009, 09:46 PM
i figure out that im suppose to put stuff about the id vendor in the file. i used the code sudo Isusb and got this:

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0bb4:0c02 High Tech Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0408:030c Quanta Computer, Inc.

my phone is an gtc g1 so i put that info in the file and it now reads:
SUBSYSTEM=="usb", SYSFS{Bus 001 Device 002: ID 0bb4:0c02}=="0bb4", MODE="0666"


i reloaded udev but the command adb devices still doesn't work.

banana jama
May 20th, 2009, 01:55 AM
bump?

pieps
May 22nd, 2009, 04:15 AM
Are you sure your phone is set for USB debugging? Go to Settings->Applications->Development and make sure USB debugging is checked.

banana jama
May 22nd, 2009, 11:14 PM
yeah usb debugging is checked. the problem is when i type in the command adb devies it says bash command doesn't exist.

Jay-Jay
June 11th, 2009, 11:03 PM
Create a rules file.

sudo gedit /etc/udev/rules.d/51.android.rules
copy the line below and paste into this file

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
for the newer distros
or
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
for backwards compatability with older distros.


Save and close the file.

Unplug and replug your device.

"adb devices" should now show your device

itnet7
June 22nd, 2009, 07:58 PM
Just wanted to confirm creating the udev rule above worked for me on Jaunty.

Thanks for your time,

Chris C.
itnet7 #freenode

mojotexas
October 20th, 2009, 04:37 PM
This worked for me as well.
I am running it with an HTC Ion.

mTeryk
January 10th, 2010, 12:08 AM
which output ok. but i still can't run adb devices it says command not found and i can't see what i did wrong. can someone help?

Your problem isn't with the rules file, it sounds like it isn't even finding the adb tool. Try the command


which adb

If it can't find it you need to add the location of your android sdk to your PATH.

edit the file ~/.bashrc in your favorite editor and add the following export commands at the bottom. In the example below I have the SDK in my home directory. (This assumes you are using the bash shell)


export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/
export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/platforms/android-2.0.1/tools/
export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/tools/

After adding those lines run the command


source ~/.bashrc
which adb

It should now find adb and then you can see if the rest of your setup is OK.

KhaaL
March 27th, 2010, 11:27 AM
just want to add my solution. i didnt add any exception rule, i just followed these steps:

Quick Howto for ubuntu:

- download SDK 1.5 r3
- enable debug mode on the device: Settings -> Applications ->
Development -> USB debugging
- add udev rule:http://developer.android.com/intl/de/guide/developing/
device.html but use Samsung's vendor id instead: SYSFS{idVendor}
=="04e8"
- replace the adb binary by this one: http://floe.butterbrot.org/external/adb.gz
- to use ddms on a 64 bit system: http://coffeecokeandcode.blogspot.com/2009/07/ddms-on-ubuntu-64bit.html

Patched adb thanks to Flori7500 as mentioned in my previous post.

Cheers, Olaf

Working fine on lucid beta.

Taken from http://groups.google.com/group/android-developers/msg/ae589dcd4ce8810d

rockwel
July 31st, 2010, 01:45 AM
Your problem isn't with the rules file, it sounds like it isn't even finding the adb tool. Try the command


which adbIf it can't find it you need to add the location of your android sdk to your PATH.

edit the file ~/.bashrc in your favorite editor and add the following export commands at the bottom. In the example below I have the SDK in my home directory. (This assumes you are using the bash shell)


export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/
export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/platforms/android-2.0.1/tools/
export PATH=${PATH}:${HOME}/SDK/android-sdk-linux_86/tools/After adding those lines run the command


source ~/.bashrc
which adbIt should now find adb and then you can see if the rest of your setup is OK.

thanks! this was my trouble