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

  • 相关阅读:
    [luoguP2221] [HAOI2012]高速公路(线段树)
    SICP:对数步数内迭代计算幂的函数
    python__tkinter之listbox&button
    C陷阱与缺陷 之 各种知识技巧
    ACM && Find Minimum in Rotated Sorted Array
    windows编程一些小知识
    Linux_C pthread 关于多线程一个简单的程序
    ACM&贪心算法
    Linux_C socket 数据报之client, server.c
    Linux_C socket 数据报之一些辅助函数
  • 原文地址:https://www.cnblogs.com/arrongao/p/Ubuntu_Android.html
Copyright © 2011-2022 走看看