Ubuntu 配置 MTP

来自Silica Library | 間奏時光
跳到导航 跳到搜索

前言

  之前一直想把整个环境切换到 Linux 下,但这操蛋的 MTP 让我有了继续留在 Windows 的理由。然而今天费了点时间还是找到了方法。
  总之一路上就是蛋疼。

步骤

[1] 安装依赖库
sudo apt-get install libmtp-common mtp-tools libmtp-dev libmtp-runtime libmtp9

[2] 把自己扔进 fuse 组

[3] 编辑 /etc/fuse.conf
#/etc/fuse.conf – Configuration file for Filesystem in Userspace (FUSE)

#Set the maximum number of FUSE mounts allowed to non-root users.
#The default is 1000.
#mount_max = 1000

# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other

[4] 查看 USB 设备代码
:lsusb 
[5] 编辑 /lib/udev/rules.d/69-mtp.rules
# Android Phone
ATTR{idVendor}==”设备代码”, ATTR{idProduct}==”设备代码”, SYMLINK+=”libmtp-%k”, ENV{ID_MTP_DEVICE}=”1″, ENV{ID_MEDIA_PLAYER}=”1″

[6] 编辑 /etc/udev/rules.d/51-android.rules
ATTR{idVendor}==”设备代码”, ATTR{idProduct}==”设备代码”, MODE=”0666″

[7] 重启 udev
sudo service udev restart

[8] 重新插上手机

[9] 完