Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jul 2019 22:47:53 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Manish Jain <bourne.identity@hotmail.com>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: How to explore Android device files under FreeBSD ?
Message-ID:  <20190713224753.f5e51166.freebsd@edvax.de>
In-Reply-To: <AM0PR03MB45946F28AAF9A2F51F97A589F6CD0@AM0PR03MB4594.eurprd03.prod.outlook.com>
References:  <AM0PR03MB45946F28AAF9A2F51F97A589F6CD0@AM0PR03MB4594.eurprd03.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 13 Jul 2019 18:49:30 +0000, Manish Jain wrote:
> Somebody has asked me for some images on my Android phone.
> 
> So I first need to download those files from the phone to my FreeBSD box 
> and then email them.
> 
> 
> Is there some way I can do that ?

It is not intended by the manufacturer, that's why it's hard to do.
It's of course not impossible, but the more you want, the less easy
it becomes.

Summary:

By default, parts of the file system are usually accessible as USB
direct storage device when connected to a computer. You you can
mount them or take an image. Maybe there is some interaction on
the phone required, maybe some setting you need to enable (like
"Android developer something" nonsense), but your system should
detect the attached device.

For example, if /dev/da0 is the device detected (check "dmesg"
output), you can do this:

	# mount -t msdosfs -o ro /dev/da0 /mnt
	...
	# umount /mnt

Depending on how the partitioning is represented, instead of
/dev/da0, /dev/da0s1 could be required. Check which files have
been created in /dev.

But as I said, this is only "part of the truth", i. e., only a
subset of the file system can be accessed this way, compare it
to a "chroot'ed environment". Depending on where the image files
are actually located, you _could_ have access to them, or not.

If you install the package android-tools-adb, you can use the adb
command line program to access your phone. But this includes the
limitation mentioned above. However, downloading stuff from the
phone is very easy with this tool (I have tried this myself some
years ago).

Furthermore, some phones don't represent their content as USB
mass storage, but they provide a MTP interface which is common
for digital cameras. Tools like gphoto2 (CLI) and gtkam (GUI)
can be used to get images and media from the phone (I also have
tried this, works very good, even with iPad).

The only way to deal with the "subtree restriction" mentioned
above is to "root" the phone. This might lead to a loss of
waranty of other problems I have no idea of. :-)



> My Android phone does not have a USB port, but it does have a micro USB 
> port (which I use for
> charging the phone).

You should be able to use a USB-A<--->USB-micro-B cable to connect
the phone to your computer. I'm quite sure this is not just for
connecting power, but also for connecting data. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190713224753.f5e51166.freebsd>