由於工作原因….我手中沒有直接能用到Windows 系統,前幾天連最後一台windows 台式機也進化成CentOS了…導致安卓裝置的資料線串連電腦只能充電不能訪問行動裝置的儲存…..
1、安裝MTP工具集: Python mr_liu@i-it:~$ sudo apt-get install mtp-tools mtpfs mr_liu@i-it:~$ dpkg -l mtp-tools mtpfs Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============================-==============================-============================================================================ ii mtp-tools 1.1.3-1ubuntu0.1 Media Transfer Protocol (MTP) library tools ii mtpfs 0.9-3build1 FUSE filesystem for Media Transfer Protocol devices
1 2 3 4 5 6 7 8 9 10 |
mr_liu @ i - it : ~ $ sudo apt - get install mtp - tools mtpfs mr_liu @ i - it : ~ $ dpkg - l mtp - tools mtpfs Desired = Unknown / Install / Remove / Purge / Hold | Status = Not / Inst / Conf - files / Unpacked / halF - conf / Half - inst / trig - aWait / Trig - pend | / Err ? = ( none ) / Reinst - required ( Status , Err : uppercase = bad ) || / Name Version Description ++ + -= === === === === === === === === === == -= === === === === === === === === === == -= === === === === === === === === === === === === === === === === === === === === === === === === === ii mtp - tools 1.1.3 - 1ubuntu0.1 Media Transfer Protocol ( MTP ) library tools ii mtpfs 0.9 - 3build1 FUSE filesystem for Media Transfer Protocol devices |
2、檢測裝置的 idVendor 和 idProduct Python mr_liu@i-it:~$ mtp-detect | grep idVendor Device 0 (VID=1949 and PID=000d) is UNKNOWN. mr_liu@i-it:~$ 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 002: ID 045e:07b2 Microsoft Corp. Bus 003 Device 003: ID 1949:000d Lab126
1 2 3 4 5 6 7 8 |
mr_liu @ i - it : ~ $ mtp - detect | grep idVendor Device 0 ( VID = 1949 and PID = 000d ) is UNKNOWN . mr_liu @ i - it : ~ $ 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 002 : ID 045e : 07b2 Microsoft Corp . Bus 003 Device 003 : ID 1949 : 000d Lab126 |
3、在linux 裡面不需要為Pad或安卓手機安裝裝置驅動,但需要添加訪問規則,如下,編輯/etc/udev/rules.d/51-android.rules Python #如前面通過lsusb和mtp-detect擷取到到裝置ID號 對應到變更到下面的配置中# mr_liu@i-it:~$ sudo cat /etc/udev/rules.d/51-android.rules SUBSYSTEM=="usb", ATTR{idVendor}=="1949", ATTR{idProduct}=="000d", MODE="0666" #建立一個目錄作為我裝置的掛載點# mr_liu@i-it:~$ mkdir my-kindle #掛載裝置# mr_liu@i-it:~$ sudo mtpfs -o allow_other my-kindle/ mr_liu@i-it:~$ ls my-kindle/ Alarms Baidu_music Documents kindle Pictures Ringtones Android Books Download Movies Playlists sogou Audible cleanmaster_cn FileRecv_QQHD Music Podcasts Tencent baidu DCIM gameloft Notifications Qzone #卸載裝置# umount ~/my-kindle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#如前面通過lsusb和mtp-detect擷取到到裝置ID號 對應到變更到下面的配置中# mr_liu @ i - it : ~ $ sudo cat / etc / udev / rules . d / 51 - android . rules SUBSYSTEM == "usb" , ATTR { idVendor } == "1949" , ATTR { idProduct } == "000d" , MODE = "0666" #建立一個目錄作為我裝置的掛載點# mr_liu @ i - it : ~ $ mkdir my - kindle #掛載裝置# mr_liu @ i - it : ~ $ sudo mtpfs - o allow_other my - kindle / mr_liu @ i - it : ~ $ ls my - kindle / Alarms Baidu_music Documents kindle Pictures Ringtones Android Books Download Movies Playlists sogou Audible cleanmaster_cn FileRecv_QQHD Music Podcasts Tencent baidu DCIM gameloft Notifications Qzone #卸載裝置# |