您的位置:首页 > 移动开发 > Android开发

Ubuntu 14.04 Android 环境搭建错误解决(adb)

2014-04-24 19:36 483 查看
在一个全新的ubuntu14.04系统搭建android开发环境,下载jdk,sdk什么的就不啰说了。

问题一:

在打开sdk里自带的eclipse时,马上报

adb: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64

执行 sudo apt-get install ia32-libs ###无效,不要没看完就复制

正在读取软件包列表... 完成

正在分析软件包的依赖关系树

正在读取状态信息... 完成

现在没有可用的软件包 ia32-libs,但是它被其它的软件包引用了。

这可能意味着这个缺失的软件包可能已被废弃,

或者只能在其他发布源中找到

可是下列软件包取代了它:

lib32z1 lib32ncurses5 lib32bz2-1.0

E: 软件包 ia32-libs 没有可供安装的候选者

解决方法:sudo apt-get install lib32ncurses5 lib32stdc++6

问题二:usb调试时,手机无法识别

$ adb devices

List of devices attached

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

解决方法:

1)断开手机连接先执行eeeeee@tsc:~$ lsusb

Bus 002 Device 002: ID 8087:8000 Intel Corp.

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:8008 Intel Corp.

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 006: ID 0cf3:3004 Atheros Communications, Inc.

Bus 003 Device 003: ID 040b:2013 Weltrend Semiconductor

Bus 003 Device 002: ID 174f:1474 Syntek

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

连接手机,再执行一次lsusb

Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
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 006: ID 0cf3:3004 Atheros Communications, Inc.
Bus 003 Device 009: ID 18d1:9025 Google Inc.
Bus 003 Device 003: ID 040b:2013 Weltrend Semiconductor
Bus 003 Device 002: ID 174f:1474 Syntek
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


那多出来的Bus 003 Device 009: ID 18d1:9025 Google Inc. 就是你的手机,我的时小米的。

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

[plain] view
plaincopy





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

内容填写如下

[plain] view
plaincopy





SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9025",MODE="0666"

##修改18d1和9025,把他改成你的设备##

3、运行以下命令:

[plain] view
plaincopy





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

sudo /etc/init.d/udev restart

4、在 Android sdk 的 tools 目录下运行 (这一步很重要,必须要sudo,否则没效果)

[plain] view
plaincopy





sudo ./adb kill-server

5、修改完成后,将手机USB线与电脑断开,再连就会显示OK !

[plain] view
plaincopy





$ adb devices

List of devices attached

1234567890ABCDEF device
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: