ubuntu连接安卓设备
1.首先安装MTP软件
apt-getinstallmtpfslibmtp-commonmtp-toolslibmtp-devlibmtp-runtimelibmtp9
2.编辑/etc/fuse.conf文件
#/etc/fuse.conf-ConfigurationfileforFilesysteminUserspace(FUSE)#SetthemaximumnumberofFUSEmountsallowedtonon-rootusers.#Thedefaultis1000.#mount_max=1000#Allownon-rootuserstospecifytheallow_otherorallow_rootmountoptions.user_allow_other
如上所示取消最后一行的注释
3.查询自己的安卓设备
lsusbBus002Device003:ID17ef:1003LenovoIntegratedSmartCardReaderBus002Device006:ID05c6:6774Qualcomm,Inc.Bus002Device002:ID8087:0024IntelCorp.IntegratedRateMatchingHubBus002Device001:ID1d6b:0002LinuxFoundation2.0roothubBus001Device004:ID04f2:b221ChiconyElectronicsCo.,LtdintegratedcameraBus001Device003:ID0a5c:217fBroadcomCorp.BCM2045B(BDC-2.1)Bus001Device002:ID8087:0024IntelCorp.IntegratedRateMatchingHubBus001Device001:ID1d6b:0002LinuxFoundation2.0roothub
如上第二行便是我的安卓设备,显示是高通公司记住ID号码05c6和6774
4.添加udev规则
vim/lib/udev/rules.d/69-mtp.rules#A0001ATTR{idVendor}=="05c6",ATTR{idProduct}=="6774",SYMLINK+="libmtp-%k",ENV{ID_MTP_DEVICE}="1",ENV{ID_MEDIA_PLAYER}="1"vim/etc/udev/rules.d/51-android.rulesATTR{idVendor}=="05c6",ATTR{idProduct}=="6774",MODE=”0666"
如上第三步得到的ID在这里用上了。
5.重启udev服务
serviceudevrestart
至此,我的一加手机已经可以通过MTP协议连接到ubuntu上面了。值得注意的是以上操作都是在root下完成的。如果root是禁用状态的朋友们请使用sudo命令。如果当前账户不在sudo组里可以参考我的另一个文章,进入recovery模式将该用户添加到sudo组里。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。