ubuntu下设置Android手机驱动

简介:

如果下面的文章不好使,建议读一这个文章:http://forum.xda-developers.com/xperia-u/general/howto-usb-connection-to-ubuntu-t1574551

以下内容有时候会导致,有的时候手机无法识别,请读上面的文章。

默认情况下 Ubuntu系统无法识别android手机。

运行 adb devices 将会出现一堆 ???号

在这种情况下你可以按照如下方法解决

1.首先查看你手机的ID号

  在terminal下运行lsusb命令

  再将手机连接上电脑

  再次运行lsusb就会多出一个usb信息。该信息即为你手机的usb信息

  Bus 002 Device 007: ID 18d1:4e21  

  PS:红色字体为手机的ID号,同一款手机的ID号是一样的。本人手机为(NS)

2  .创建配置文件

sudo vim /etc/udev/rules.d/XXX.rules

XXX为你自定义的文件名

输入以下 内容

SUBSYSTEM=="usb", SYSFS{"idVendor"}=="18d1", MODE="0666"

在红色字体的部分 添加上 你 自己手机的id

    sudo chmod a+rx /etc/udev/rules.d/XXX.rules

    sudo /etc/init.d/udev restart

3.重启adb服务(必须为sudo 已配置android环境变量)

    sudo ./adb kill-server

    sudo ./adb devices

---------------------------------------------------------------------
you want MTP support on Ubuntu, try this:
  1. Connect Xperia S to an USB2 port.
  2. Use the "lsusb" command to list your devices in a terminal
    One of the lines should look like this:
    Code:
    Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB
  3. Note your vendor- and product id. Usually this is "0fce" for the vendor and "5169" for the product id. If you have USB debugging disabled, product id will be "0169".
  4. unplug your phone
  5. read this thread: humans-enabled.com
    Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described
  6. Edit: This step may not be necessary for you! 
    Xperia S support is implementet in the libmtp-1.1.3. release. If you use the newest version fromsourceforge.net
     skip this and go to step 7.


    type following to edit the copied file as root:
    Code:
    sudo gedit /etc/udev/rules.d/69-libmtp.rules
    Add the following text somewhere around the sony ericsson devices that are in this file. You can find them by searching for "0fce". Remember to set the correct vendor and product id:
    Code:
    # Sony Xperia S
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
  7. reboot, or use
    Code:
    sudo udevadm control --reload-rules
    to actualise.
  8. Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.
本文转自demoblog博客园博客,原文链接http://www.cnblogs.com/0616--ataozhijia/p/3658649.html如需转载请自行联系原作者

demoblog
相关文章
|
Ubuntu Linux 程序员
Ubuntu 18.04 安装详细步骤与设置指南
接下来,我们将探讨如何进行个人信息设置。重启选择高级模式,联网更新软件包并安装硬件驱动程序以完成个人信息设置。在重启过程中,你需要按下esc键(只需按一下)来选择ubuntu的高级模式。重启完成后,请联网并打开终端,然后输入以下字符以继续设置过程。
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
13028 4
|
Ubuntu 关系型数据库 MySQL
Ubuntu 22.04.1上安装MySQL 8.0及设置root密码的注意事项
这些是在Ubuntu 22.04.1 系统上安装MySQL 8.0 及设置root密码过程中必须考虑的关键点。正确的遵循这些步骤可确保MySQL的安装过程既顺利又安全。
2227 20
|
Ubuntu Shell Python
Ubuntu学习笔记(一):pycharm设置快捷启动图标详解
这篇博客详细讲解了如何在Ubuntu 20.04系统中为PyCharm设置快捷启动图标,包括创建.desktop文件、编辑文件内容以及添加到收藏夹的步骤。
1762 0
Ubuntu学习笔记(一):pycharm设置快捷启动图标详解
|
Ubuntu
在Ubuntu系统上设置syslog日志轮替与大小限制
请注意,在修改任何系统级别配置之前,请务必备份相应得原始档案并理解每项变更可能带来得影响。
1356 2
|
网络协议 Ubuntu
在Ubuntu 18.04/20.04 LTS设置静态DNS服务器的过程。
以上步骤提供了一种简洁明了的指导,让用户能够在Ubuntu系统中有效设置静态DNS服务器,这对日常管理和网络配置来说是非常实用的技能。
2033 18
|
监控 Ubuntu Linux
在Ubuntu环境中制定脚本开机自动启动设置
以上就是在Ubuntu环境下制定脚本开机自动启动的设置方法。通过Systemd服务,你可以按需要轻松管理脚本的自动执行。全新的一天开始时,脚本已静静地运行,无需额外手动启动,机器恰如一位忠诚的仲夏夜的梦想者,在黎明的许诺中尽职尽责。于是心满意足地看着,任由它在自己选择的轨道上静静地飞翔。
1911 26
|
Ubuntu 数据安全/隐私保护
在Ubuntu系统中增加Openfire服务设置和管理
至此,你已经完成了在Ubuntu中增加Openfire服务的设置和管理。希望你在这个过程中,能像享受一场摇滚音乐会一样,体验编程的乐趣和成就感。祝你玩得开心!
341 27