1,首先要查看只能机的idVendor,在http://developer.android.com/tools/device.html这里可以查到。我的是华为的智能机U9200,所以idVendor=12d1
2,# cd /etc/udev/rules.d/,进到这个文件夹下,然后 #gedit 51-android.rules,即新建一个名字为51-android.rules的文件,然后在里面输入:
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev"
,SYMLINK+="android_adb"
(参考http://developer.android.com/tools/device.html,以及http://210.38.138.176/archiver/?tid-36.html)
注意,这里将idVendor设成自己的智能机对应的即可。
然后保存。
3,修改权限。#chmod a+r /etc/udev/rules.d/51-android.rules
4,点击Eclipse的run configuration,选择target,点中manual,然后就可以了。
注,windows下貌似只安一个usbdriver就可以了。
补充:如果是windows下的开发环境,需要安装两个东西。
一个是google的usbdriver,http://developer.android.com/sdk/win-usb.html#top可以通过下载离线安装包,点击download google usbdriver。或者用sdk在线下载的方法。
安装方法如下:
Windows XP
To install the Android USB driver on Windows XP for the first time:
- Connect your Android-powered device to your computer's USB port. Windows will detect the device and launch the Hardware Update Wizard.
- Select Install from a list or specific location and click Next.
- Select Search for the best driver in these locations; un-check Search removable media; and check Include this location in the search.
- Click Browse and locate the USB driver folder. (The Google USB Driver is located in
<sdk>\extras\google\usb_driver\
.) - Click Next to install the driver.
Or, to upgrade an existing Android USB driver on Windows XP with the new driver:
- Connect your Android-powered device to your computer's USB port.
- Right-click on My Computer from your desktop or Windows Explorer, and select Manage.
- Select Device Manager in the left pane.
- Locate and expand Android Phone in the right pane.
- Right-click Android Composite ADB Interface and select Update Driver. This will launch the Hardware Update Wizard.
- Select Install from a list or specific location and click Next.
- Select Search for the best driver in these locations; un-check Search removable media; and check Include this location in the search.
- Click Browse and locate the USB driver folder. (The Google USB Driver is located in
<sdk>\extras\google\usb_driver\
.) - Click Next to upgrade the driver.
另一个是各个厂家的手机驱动,列表在这里:http://developer.android.com/tools/extras/oem-usb.html