首先,要在新建一個文件:/etc/udev/rules.d/51-android.rules.,即是51-android.rules
文件的示例內容爲
SUBSYSTEM=="usb", ATTR{idVendor}=="e4e8", MODE="0666", GROUP="plugdev"
其中,venderId 是代表不同設備商,mode 指的是該設備的讀寫權限,group 代表這個設備屬於那個組
保存文件後,執行
chmod a+r /etc/udev/rules.d/51-android.rules
(注意,以上的操作都是要在root下進行)
然後從新跑一下你的android程序,就可以發現eclipse可以識別你的機子並把它安裝到真機上了。。
下面是不同廠商對應的venderId,我的機子是三星的,對應是“04e8”
USB Vendor IDs
This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the ATTR{idVendor}property in the rules file, as described above.
Company | USB Vendor ID |
---|---|
Acer | 0502 |
ASUS | 0b05 |
Dell | 413c |
Foxconn | 0489 |
Fujitsu | 04c5 |
Fujitsu Toshiba | 04c5 |
Garmin-Asus | 091e |
18d1 | |
Hisense | 109b |
HTC | 0bb4 |
Huawei | 12d1 |
K-Touch | 24e3 |
KT Tech | 2116 |
Kyocera | 0482 |
Lenovo | 17ef |
LG | 1004 |
Motorola | 22b8 |
NEC | 0409 |
Nook | 2080 |
Nvidia | 0955 |
OTGV | 2257 |
Pantech | 10a9 |
Pegatron | 1d4d |
Philips | 0471 |
PMC-Sierra | 04da |
Qualcomm | 05c6 |
SK Telesys | 1f53 |
Samsung | 04e8 |
Sharp | 04dd |
Sony | 054c |
Sony Ericsson | 0fce |
Teleepoch | 2340 |
Toshiba | 0930 |
ZTE | 19d2 |