解決Ubuntu上ADB找不到設備的問題

按照google官方的說法,http://developer.android.com/tools/device.html,Ubuntu上adb鏈接設備時以下步驟操做就行:html

  1. Log in as root and create this file: /etc/udev/rules.d/51-android.rules.node

    Use this format to add each vendor to the file:
    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" 

    In this example, the vendor ID is for HTC. The 
    MODE assignment specifies read/write permissions, and GROUPdefines which Unix group owns the device node.react

    Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.android

  2. Now execute:
    chmod a+r /etc/udev/rules.d/51-android.ruleside

重啓電腦就能夠看到attached的設備了。實際操做中按照這樣的步驟,發現MTK的機連得上,高通的連不上,百度了網上的各類說法,找到了緣由和方法;ui

   緣由是adb內建有一個知名的廠商ID列表,對於列表內的設備,adb能夠直接鏈接,而不在列表中的設備,它會直接返回,這也就是爲何android設備的驅動已經安裝好了,而adb鏈接不上的緣由。若是咱們用的android設備的廠商ID被修改過,即未在google默認的列表裏,按官方的步驟就會失敗。好在adb除了內建的一個列表以後,還有一個adb_usb.ini文件維護一下可信任的第三方廠商列表,須要把VID(Vender ID)寫到adb_usb.ini中;this

Ubuntu系統下在用戶目錄下的.android目錄google

~\.android\adb_usb.inispa

若是你的系統下沒有這個文件,則須要新建一個,.net

拿到設備的廠商ID直接加入到adb_usb.ini文件就能夠了,好比你的idVendor是0bb4,你就輸入「0x0bb4」而後重複上述步驟就ok了。

裝機的時候遇到過這個問題,但願對你們有幫助。

相關文章
相關標籤/搜索