Discussion:
Accessing Files on Android Device With Linux
(too old to reply)
tb
2024-09-22 23:59:59 UTC
Permalink
I have an ASUS Zenfone Max Plus 1 with Android 8.1.0.
I also have MX Linux 21.3 on a PC.
With the PC I am trying to access the folder in the phone where pictures
are stored. So I plugged the phone using a USB cable into a port of my
PC but nothing happened.
I used my PC's File Manager to see if the phone would show up as a
plugged in device but it did not.
Is it even possible to access files on an Android device using Linux? I
would think so since Android is a derivative of Linux, but one never
knows...
Thanks.
--
tb
Harry S Robins
2024-09-23 03:01:22 UTC
Permalink
Post by tb
I have an ASUS Zenfone Max Plus 1 with Android 8.1.0.
I also have MX Linux 21.3 on a PC.
With the PC I am trying to access the folder in the phone where pictures
are stored. So I plugged the phone using a USB cable into a port of my
PC but nothing happened.
I used my PC's File Manager to see if the phone would show up as a
plugged in device but it did not.
Is it even possible to access files on an Android device using Linux? I
would think so since Android is a derivative of Linux, but one never
knows...
A lot depends on the version of Android and how it's set up, but most will
work with Linux if you're willing to use the command line to mount it.

The first step is to find out which transfer protocol the phone is set to.
https://wiki.archlinux.org/title/Media_Transfer_Protocol

http://www.webupd8.org/2012/12/how-to-mount-android-40-ubuntu-go-mtpfs.html

Mounting an Android 4.0+ device in Ubuntu is pretty tricky, but there is a
FUSE filesystem called Go-mtpfs, created by a Google employee because
"mtpfs was very unstable" for him, which works great. Read on to find out
how to use it and easily install it in Ubuntu using a PPA!


https://github.com/hanwen/go-mtpfs

Go-mtpfs is a simple FUSE filesystem for mounting Android devices as a MTP
device. It will expose all storage areas of a device in the mount, and only
reads file metadata as needed, making it mount quickly. It uses Android
extensions to read/write partial data, so manipulating large files requires
no extra space in /tmp. It has been tested on various flagship devices
(Galaxy Nexus, Xoom, Nexus 7). As of Jan. 2013, it uses a pure Go
implementation of MTP, which is based on libusb.
Dave Royal
2024-09-23 07:15:20 UTC
Permalink
Post by tb
I have an ASUS Zenfone Max Plus 1 with Android 8.1.0.
I also have MX Linux 21.3 on a PC.
With the PC I am trying to access the folder in the phone where pictures
are stored. So I plugged the phone using a USB cable into a port of my
PC but nothing happened.
I used my PC's File Manager to see if the phone would show up as a
plugged in device but it did not.
Is it even possible to access files on an Android device using Linux? I
would think so since Android is a derivative of Linux, but one never
knows...
Thanks.
Every device and Android version I've had has behaved slightly
differently. It could be hit-and-miss in the past but these days
it's pretty easy. But there are tricks.

Get the phone to use MTP when a usb cable is plugged in. It will
probably default to charging (and there is PTP too but I've not
seen it recently). That may be in settings. I've known it to be
in advanced settings, and even in developer mode. It you don't
find that nothing will work. Try different USB ports: one I had
preferred USB 2 ones.

When you plug in the cable for the first time make sure the phone
is on and you're looking at it! Mine (Android 13) puts up a
momentary access permission request. Past devices have put a usb
icon top-left which I had to pull down and select MTP. One asked
whether to trust the PC in future.

On my Linux (SUSE) and if MTP is selected a Samsung desktop icon
appears . I click to mount and open a window (it's using FUSE)
but I don't see any files until I've granted permission on the
phone. I then have to refresh to see them.
--
Remove numerics from my email address.
Carlos E.R.
2024-09-23 07:43:59 UTC
Permalink
Post by tb
I have an ASUS Zenfone Max Plus 1 with Android 8.1.0.
I also have MX Linux 21.3 on a PC.
With the PC I am trying to access the folder in the phone where pictures
are stored.  So I plugged the phone using a USB cable into a port of my
PC but nothing happened.
I used my PC's File Manager to see if the phone would show up as a
plugged in device but it did not.
Is it even possible to access files on an Android device using Linux?  I
would think so since Android is a derivative of Linux, but one never
knows...
Basically you have to tell Android to share files via USB cable.
Normally the phone will ask on plugin what for you want to use the USB
connection. Power, share photos, share files. You have to tap one of the
two later options. This activates MTP protocol.

On ancient Android a different method was used, the
filesystem was disconnected from Android and the
computer saw a normal USB filesystem.


Once MTP is activated, the desktop will see the phone files, using the
graphical file browser: Nautilus, Thunar, Dolphin... or the CLI.
--
Cheers, Carlos.
Siard
2024-09-23 09:02:43 UTC
Permalink
Post by tb
Is it even possible to access files on an Android device using Linux?
Apart from using a USB cable, there is another easy way to access files
from Linux or any other OS.

Install an FTP server on your phone. I have this one: "WiFi FTP Server"
https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver&hl=en

Then from your PC, you can access the files with an FTP program, such as
gftp or FileZilla. It is lightning fast.
Joerg Walther
2024-09-23 14:38:49 UTC
Permalink
Post by Siard
Install an FTP server on your phone. I have this one: "WiFi FTP Server"
https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver&hl=en
Seconded. I use the same app, but on my Linux notebook I used Double
Commander to access the files on my mobile.

-jw-
--
And now for something completely different...
Gelato
2024-09-23 15:40:00 UTC
Permalink
Post by Joerg Walther
Post by Siard
Install an FTP server on your phone. I have this one: "WiFi FTP Server"
https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver&hl=en
Seconded. I use the same app, but on my Linux notebook I used Double
Commander to access the files on my mobile.
Tripled, where on a Windoze PC I use FTP servers to mount the Android too!
https://www.ferrobackup.com/map-ftp-as-disk.html
Siard
2024-09-23 19:34:28 UTC
Permalink
Post by Siard
Install an FTP server on your phone. I have this one: "WiFi FTP Server"
https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver&hl=en
Seconded. I use the same app, but on my Linux notebook I used Double Commander
to access the files on my mobile.
Yes, file managers usually have an option to connect via FTP as well.
Gelato
2024-09-23 20:10:40 UTC
Permalink
Post by Siard
Post by Siard
Install an FTP server on your phone. I have this one: "WiFi FTP Server"
https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver&hl=en
Seconded. I use the same app, but on my Linux notebook I used Double Commander
to access the files on my mobile.
Yes, file managers usually have an option to connect via FTP as well.
Better for file managers to connect to http or webdav servers, isn't it?
Loading...