在ubuntu 9.04下通過usb連接g1,使用adb時,會返回無法找到設備,解決辦法如下:
1) 在終端運行 lsusb
會發現結果有會有如下類似記錄:
Bus 002 Device 015: ID 0bb4:0c02 High Tech Computer Corp.
2)
sudo gedit /etc/udev/rules.d/50-android.rules
在打開的文件中增加以下文本:
SUBSYSTEM==”usb”, SYSFS{
“High Tech Computer Corp.
“
}==”0bb4″, MODE=”0666″
3) sudo gedit /etc/udev/rules.d/90-android.rules
在打開的文件中增加以下文本:
SUBSYSTEM==”usb”, ATTR{
“High Tech Computer Corp.
“
}==”0bb4″, MODE=”0666″
4) 運行以下命令: sudo chmod a+rx /etc/udev/rules.d/50-android.rules
sudo chmod a+rx /etc/udev/rules.d/90-android.rules
sudo /etc/init.d/udev restart
5) 在android sdk的tools
目錄下運行
sudo ./adb kill-server
sudo ./adb devices
OK~搞定,接下來使用./adb shell等指令都正常了!
Here's what works for me on Ubuntu Karmic with my Htc Dream (Vendor ID
0bb4 as seen with 'lsusb') :
- device in usb debug mode (settings/applications/developpment/)
- in file /etc/udev/rules.d/51-android.rules :
SUBSYSTEM=3D=3D=E2=80=9Dusb=E2=80=9D,ATTRS(idVendor)=3D=3D=E2=80=9D0bb4=E2=
=80=9C,SYMLINK
+=3D"android_adb",MODE=3D=E2=80=9D0666=E2=80=B3
- chmod a+x /etc/udev/rules.d/51-android.rules (don't think it's
necessary, though)
- killall adb
- /etc/init.d/udev restart ; /etc/init.d/udev-finish restart
- adb in $PATH
Now 'adb devices' lists my device.
http://www.johandekoning.nl/index.php/2009/02/07/android-dev-phone-ubuntu-and-vmware-server/
Udev configuration
You can perform a check, to see that the Android Dev Phone is shared
with Ubuntu, by opening a Terminal (inside Ubuntu. Open a VMWare Remote
Console to make use of the Ubuntu) and type the following command
lsusb
A list of USB devices will be shown. For example:
Bus 002 Device 001: ID ld6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0bb4:0c02 High Tech Computer Corp.
Bus 001 Device 001: ID ld6b:0002 Linux Foundation 2.0 root hub
The Android Dev Phone is the device with the name High Tech Computer
Corp (HTC). Make a note of the first part of the device ID (in this case
0bb4) because this is needed for the udev rule.
Create a new file (as root)
sudo gedit /etc/udev/rules.d/50-android.rules
with the following content
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Make sure that the text after {idVendor} is the same as the device id
found when using the lsusb command. Save and exit the editor
To make execution of the rule possible, perform a chmod
sudo chmod a+rx /etc/udev/rules.d/50-android.rules
To make the rule active, restart udev
sudo /etc/init.d/udev restart
|