DEV Community

Cover image for How to access android files from linux terminal

Posted on

How to access android files from linux terminal

Hi there,
If you ever wanted to know how to access our android phone files from terminal, without using any third party app and just with a USB cable and GNome, here is how:

We need to check the GNOME Virtual file system (gfvs) to see it is available.

run the following command:

ls /run/user/1000/gvfs/

You will get an Media Transfer Protocol (mtp), for more about this, check this link: MTP


Now use it as it would be any other directory on your system

cd /run/user/1000/gvfs/mtp:host=PHONE_MANUFACTURER_AND_MODEL

Done, you can access your phone directory and do whaterver you want.


Top comments (1)

jjgumucio profile image
Joaquin Gumucio L.

What if as a result of running the ls /run/... command I don't get the MTP information?

I have my android phone plugged in and USB debug active.