在Ubuntu下解決 adb devices :???????????? no permission

來源:互聯網
上載者:User

標籤:android   style   color   使用   strong   io   

使用 adb devices  出現如下:

List of devices attached

???????????? no permissions

同時在DDMS中顯示裝置名稱也顯示????????????,也無法顯示進程名,無法查看log。

解決方案:

1、設定usb許可權

因為ubuntu這樣的系統都是預設以非root身份在啟動並執行,要使用usb調試,需要sudo支援。

$ lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 19d2:0249 ZTE WCDMA Technologies MSM
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 17ef:6019 Lenovo
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

列表中,Bus 001 Device 003: ID 19d2:0249 ZTE WCDMA Technologies MSM. 這一行為ZTE手機的usb使用連接埠,記錄一下,id為19d2據網上的資料說,由於後來的使用Android系統的手機越來越多,每款手機都分配了idVendor,但解決方案都一樣。

$sudo vim /etc/udev/rules.d/70-android.rules

加入以下內容:

SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0249",MODE="0666"

其中的idvendor idProduct指的是USB的ID可以使用lsusb查詢得到。

比如我的是:在你沒有串連其他外設之前只要找到最後不是root hub的這一行留意下就行。

ID 19d2 就是idVendor ,0249就是 idProduct

運行命令,重啟udev:

$sudo chmod a+rx /etc/udev/rules.d/70-android.rules

$sudo service udev restart

2、不需要重啟電腦,重新啟動adb server下就ok

(很重要)拔掉usb重新連上再執行:

sudo ./adb kill-server

./adb devices

./adb root ( 這一步很重要  )

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.