Sunday, October 23, 2016

4.2 jelly bean - How do I make my Linux PC mount my Android 4.2.2 phone using MTP?


I have just purchased a new TCL (S950) Idol x phone and I'm figuring out some issue to make it visible on my system.


This phone uses Android 4.2.2 and I guess this is the cause of the issue: my previous phone with android 4.1 was correctly displayed in nautilus/dolphin ( using mtpfs )


Now I have tried to install mtp-tools but nothing has changed.



lsusb gives me that list (T & A Mobile Phones should be my phone )


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 1bbb:0168 T & A Mobile Phones
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1bcf:2b80 Sunplus Innovation Technology Inc.
Bus 002 Device 003: ID 8086:0189 Intel Corp.


dmesg gives me this output:


[15780.855333] usb 3-2: new high-speed USB device number 2 using xhci_hcd
[15780.874336] usb 3-2: New USB device found, idVendor=1bbb, idProduct=0168
[15780.874348] usb 3-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[15780.874354] usb 3-2: Product: TCL S950
[15780.874359] usb 3-2: Manufacturer: TCT
[15780.874364] usb 3-2: SerialNumber: FESKMRSOYLW8RKSK

Any idea what could be wrong here ?



UPDATE: I have added the following rules to udev (/etc/udev/rules.d/11-android.rules ) and now at least adb shell works fine:


## TLC
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}==”0167″, MODE="0777", OWNER="fra"

( change OWNER user name with yours )



Answer



As suggested by @Logos this works (take care of using sudo):


sudo mtpfs -o allow_other /media/MTPdevice

However mtpfs is very unstable on this phone so I tried go-mtpfs and I found out it works better. You can install go-mtpfs using the info provided in their site



The command to mount the phone is very similar (change the bin path according to yours) :


sudo /usr/lib/go/bin/go-mtpfs /media/MTPdevice/

Automount
Once you are able to mount the device with the above command you can make the phone automount: You only have to add a couple of rules to udev.


You will need those info:



  • ID_MODEL (mine is TCL_S950 )

  • ID_MODEL_ID ( mine is 0167 )

  • Installation path of go-mtpfs ( mine is /usr/lib/go/bin/go-mtpfs )



You can find those info running this command in a terminaludevadm monitor --environment --udev and plug/unplug your phone.


Now you can create/edit an udev rules /etc/udev/rules.d/99-android.rules and add these lines (change ID_MODEL and ID_MODEL_ID with yours):


 # Mount  
ENV{ID_MODEL}=="TCL_S950", ENV{ID_MODEL_ID}=="0167", ACTION=="add", RUN+="/usr/bin/sudo -b /usr/lib/go/bin/go-mtpfs -allow-other=true /media/MTPdevice"
# Umount
ENV{ID_MODEL}=="TCL_S950", ENV{ID_MODEL_ID}=="0167", ACTION=="remove", RUN+="/bin/umount /media/MTPdevice"

At this point everything should work, check this thread for more details: source


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...