how to access android mobile from bash

Colin Law clanlaw at gmail.com
Thu May 5 14:41:54 UTC 2016


On 5 May 2016 at 14:08, robert rottermann <robert at redcor.ch> wrote:
> thanks Colin
> On 05.05.2016 13:32, Colin Law wrote:
>>
>> On 5 May 2016 at 12:13, robert rottermann <robert at redcor.ch> wrote:
>>>
>>> Hi there,
>>>
>>> I have ubuntu 16.04 installed.
>>> when I attach an android device a files browser windows pups up and I can
>>> navigate trough the files on the phone.
>>> However I would like to download the files using rsync. So I try to
>>> access
>>> them using bash commands.
>>>
>>> In 14.10 (15.10??) this could be done using the path:
>>> ls -l /run/user/1000/gvfs
>>> but now this gives a permission denied error (even as root).
>>
>> If you browse to /run/user/1000/gvfs in nautilus (or cd there in the
>> command line) you will see your device as mtp:host=<something>  That
>> is the path to use.
>
> if I browse there I get an entry:
>     mtp:host=%5Busb%3A002%2C006%5D
> and I can navigate to some file like:
>     mtp://[usb:002,006]/Phone/Download/DSC03119.jpg
>
> however, how can i use this info on the command line say to copy the file
> DSC03119.jpg?

You should just be able to
cp /run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Phone/Download/DSC03119.jpg
.
or possibly
cp /run/user/1000/gvfs/mtp://[usb:002,006]/Phone/Download/DSC03119.jpg .
How did you see the path in that format?

Colin




More information about the ubuntu-users mailing list