歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 12.04 64位 使用 Android 問題解決

Ubuntu 12.04 64位 使用 Android 問題解決

日期:2017/2/28 15:29:46   编辑:Linux教程

問題1:
Google 已經發布 ADT 17.0.0 和 SDK R17版本 ,於是乎在 Ubuntu 12.04 X64 上裝了下,結果無法運行 adb 命令,錯誤如下:

adb: error while loading shared libraries:libncurses.so.5: wrong ELF class: ELFCLASS64

查度娘,翻谷歌 該問題還挺普遍,特別針對 64位 Ubuntu ,其實就一句話,沒有找到 公共庫 ,運行以下命令即可搞定。

追加問題:最近重裝系統後,環境變量配置完畢,明明就在adb 目錄中運行 adb 命令但老顯示 sudo: adb: command not found ,處理方法還是下載 32 位支持庫。

$ sudo apt-get install ia32-libs

問題2:

adb devices 沒有權限

  1. $ adb devices
  2. List of devices attached
  3. ???????????? no permissions

網上解決很多,大致相同,我將自己機器的處理方法記錄一下

1、 lsusb 查看 USB 設備情況

  1. $ lsusb
  2. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  3. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  4. Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
  5. Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
  6. Bus 001 Device 003: ID 138a:0007 Validity Sensors, Inc. VFS451 Fingerprint Reader
  7. Bus 001 Device 004: ID 17ef:600e Lenovo
  8. Bus 001 Device 005: ID 05c8:0403 Cheng Uei Precision Industry Co., Ltd (Foxlink) Webcam
  9. Bus 002 Device 003: ID 1058:1110 Western Digital Technologies, Inc.
  10. Bus 002 Device 004: ID 062a:0201 Creative Labs Defender Office Keyboard (K7310) S Zodiak KM-9010
  11. Bus 002 Device 007: ID 05c6:9015 Qualcomm, Inc.

我的機器是高通方案某機型所以顯示 Bus 002 Device 007: ID 05c6:9015 Qualcomm, Inc. 如果你確實不知道那條是你的機器情況,就將英文部分粘貼到 google 查下就OK

2、首先使用 vim 新建一個配置文件

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

內容填寫如下

SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9015",MODE="0666"

其實每個人修改不同就兩處 idVendor 和 idProduct, 參考剛才 lsusb Bus 002 Device 007: ID05c6:9015 Qualcomm, Inc.

3、運行以下命令:

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

4、在 Android sdk 的 tools 目錄下運行 (這一步很重要,必須要sudo,否則沒效果)

sudo ./adb kill-server

5、修改完成後,將手機USB線與電腦斷開,再連就會顯示OK !

$ adb devices
List of devices attached
1234567890ABCDEF device

參考文章

Ubuntu下ADB調試Android找不到設備的解決方法 http://www.linuxidc.com/Linux/2011-04/34131.htm

Copyright © Linux教程網 All Rights Reserved