如果下面的文章不好使,建议读一这个文章: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 restart3.重启adb服务(必须为sudo 已配置android环境变量)
sudo ./adb kill-server
sudo ./adb devices 给梦想一点时间
---------------------------------------------------------------------
you want MTP support on Ubuntu, try this:
- Connect Xperia S to an USB2 port.
- 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
- 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".
- unplug your phone
- read this thread: Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described
- 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 from 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
Code:# Sony Xperia SATTR{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"
- reboot, or use Code:
sudo udevadm control --reload-rules
- Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.