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

在一个全新的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调试时,手机无法识别

  1. $ adb devices  
  2. List of devices attached   
  3. ????????????    no permissions  
解决方法:

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

  1. 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 

  1. 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 plain copy 在CODE上查看代码片 派生到我的代码片
  1. $ sudo vim /etc/udev/rules.d/70-android.rules  

内容填写如下

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9025",MODE="0666" 

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

3、运行以下命令:

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. sudo chmod a+rx /etc/udev/rules.d/70-android.rules  
  2. sudo /etc/init.d/udev restart  
4、在 Android sdk 的 tools 目录下运行 (这一步很重要,必须要sudo,否则没效果)

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. sudo ./adb kill-server  

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

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $ adb devices  
  2. List of devices attached   
  3. 1234567890ABCDEF    device  




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值