在一个全新的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 新建一个配置文件
- $ sudo vim /etc/udev/rules.d/70-android.rules
内容填写如下
- SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9025",MODE="0666"
-
- ##修改18d1和9025,把他改成你的设备##
3、运行以下命令:
- sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- sudo /etc/init.d/udev restart
- sudo ./adb kill-server
5、修改完成后,将手机USB线与电脑断开,再连就会显示OK !
- $ adb devices
- List of devices attached
- 1234567890ABCDEF device