zoukankan      html  css  js  c++  java
  • Ubuntu配置Android开发环境无法连接手机

    因为一直使用Ubuntu,所以想把Android也放在Ubuntu开发了,不过用小米MiOne连接后不能识别,SN是乱码,在网上找到如下解决方法:

    在/etc/udev/reles.d 文件夹下创建 51-android.rules 文件

    写入 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

    重启adb:

    $ cd your-android-sdk-linux/platform-tools
    $ sudo ./adb kill-server
    $ sudo ./adb devices

    再试成功。

    记得一定要断开手机连接后再连接一下。

    以上是在32bit下的配置方式,在64bit需要先安装如下包:

    sudo apt-get install lib32asound2 lib32z1 lib32ncurses5 lib32bz2-1.0

    否则会报如下错误:

    ./adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

     检测是否正常:

    不链接手机时输入命令lsusb,查看结果:

    arron:/etc/udev/rules.d$ lsusb
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 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 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 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 001 Device 003: ID 064e:c21c Suyin Corp. 
    Bus 001 Device 006: ID 046d:c52e Logitech, Inc. 
    Bus 001 Device 005: ID 0489:e04e Foxconn / Hon Hai 

    链接手机后输入命令lsusb,查看结果:

    arron:/etc/udev/rules.d$ lsusb
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 003 Device 006: ID 18d1:9025 Google Inc. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 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 001 Device 003: ID 064e:c21c Suyin Corp. 
    Bus 001 Device 006: ID 046d:c52e Logitech, Inc. 
    Bus 001 Device 005: ID 0489:e04e Foxconn / Hon Hai 

    可以看到端口为9025就是小米手机,“Bus 003 Device 006: ID 18d1:9025 Google Inc. ”

    参考:

    http://blog.csdn.net/chenghai2011/article/details/7270664

  • 相关阅读:
    关于同时上传多个图片的类(有点粗糙)
    关于上传图片的类(有点粗糙)
    关于分页的类(有点粗糙)
    php是什么
    关于glod方法的使用和介绍
    PHP中从数据库获取查询结果时容易出的错误及原因(smarty)
    转载- 支持Android4.0以下webp的使用
    Android用户体验
    转载-Android数据库高手秘籍(一)——SQLite命令
    转载 -安卓开发-Activity中finish() onDestroy() 和System.exit()的区别
  • 原文地址:https://www.cnblogs.com/arrongao/p/Ubuntu_Android.html
Copyright © 2011-2022 走看看