Monday, April 25, 2016

Accessing to Files on Android device

When trying to access to an Android device, I use the method by mounting it via Files. However, when trying to be able to access to the symbolic link called /storage/emulated/0/DCIM/Camera, this does not appear in there.

I went through several articles about this, and this looks much simple than actually what everyone is saying in the forums.

By default, Samsung devices use MTP or Media device Transfer Protocol instead of USB Mass Storage as any other USB driver. Therefore when running the command lsusb, you will be able to see the device attached to the computer:



However, the command mount does not display the device connected as a USB driver (normally displayed under /dev/sdaX), but it shows as a gvfsd-fuse under /run/user/1000/gvfs:

 
Note: You need to click on the device in File to mount it or mount it manually via command line for the next steps... And on the device you need to acknowledge the USB connection using MTP.

The device should be mounted under the following way:
mtp://[usb:001,021]/.

Once the device is mounted, under the folder /run/user/1000/gvfs, it's possible to see the host attached to it:


Under this I can then see the same folder called Phone that appears in Files.

However, by accessing to the folder Phone and then running ls -l, I still see the same folders that are shown in Files, and the physical link associated to the symbolic link called /storage/emulated/0/DCIM/Camera is still not there.

Therefore I run ls -la, and this in fact shows me the folder called DCIM, and in it, the folder Camera can be found:


For safe removal of the device attached from the computer, unmount and eject it from Files, or using the command line.