Linux: Access Android content via USB

0

I have Desktop-pc: Linux Mint 13, Phone: Sony Xperia V running android 4.1.2

From my desktop I want to access pictures, videos etc. on the phone.

I have enabled the "Media server" on the phone, but not sure what I need on the desktop.

dmesg | tail

18245.440537] usb 2-1.5.1: new high-speed USB device number 19 using ehci_hcd
[18245.535171] scsi12 : usb-storage 2-1.5.1:1.1
[18246.531074] scsi 12:0:0:0: CD-ROM            SONY     CD-ROM           0100 PQ: 0 ANSI: 4
[18246.534125] sr2: scsi3-mmc drive: 0x/0x caddy
[18246.534379] sr 12:0:0:0: Attached scsi CD-ROM sr2
[18246.534544] sr 12:0:0:0: Attached scsi generic sg4 type 5
[18247.023144] ISO 9660 Extensions: Microsoft Joliet Level 3
[18247.023518] ISOFS: changing to secondary root
[19024.704607] udevd[7153]: starting version 175
[19216.875359] usb 2-1.5.1: USB disconnect, device number 19
[19218.399626] usb 2-1.5: USB disconnect, device number 14
[19218.598989] usb 2-1.5: new high-speed USB device number 20 using ehci_hcd
[19218.692851] hub 2-1.5:1.0: USB hub found
[19218.693173] hub 2-1.5:1.0: 4 ports detected
[19218.966396] usb 2-1.5.1: new high-speed USB device number 21 using ehci_hcd

Vering

Posted 2013-06-05T13:44:42.070

Reputation: 126

Disconnect the phone, plug it back in and post the output of dmesg | tail please. – terdon – 2013-06-05T13:47:42.833

hmmm OK, it seems to be recognizing your phone as a USB hub. I don't have access to an android phone to try it out but this thread might help.

– terdon – 2013-06-05T13:58:21.913

Answers

0

Ok I found out a way that works for me. Just mount the SD card (but could not find out where to do it):

Go to "Settings" -> "Xperia" -> "USB connection".

I just looked the wrong place

Vering

Posted 2013-06-05T13:44:42.070

Reputation: 126

0

Did not think that would be so hard..?

I tried accessing the phone and SD storage via USB, but no UMS mode i 4.1.2. I tried with Qlix, but needed to reload Qlix a thousand times before I got access.

So for now I'll use the File Explorer in Eclipse... seems to be the best option.

Vering

Posted 2013-06-05T13:44:42.070

Reputation: 126

0

I propose a title change "... content via USB" as the media server is used for sharing content via a wi-fi network. Thus, here's a more complete answer, based on this link and on my experience with a Sony Xperia V.

  1. [linux] from your package distribution, install libmtp and a user-level application. For me, both mtpfs-v1.0 and gmtp-v1.3.5 (Gentoo builds) work, though the latter looks easier to use for organizing music albums, etc.
  2. Unplug your phone's USB cable.
  3. [android] go to Settings -> Xperia -> USB Connectivity. Set option USB connection mode, depending on how you want to access your phone contents, to either:
    • MTP, for (indirect) media access via a user-level (pseudo?) file system (preferred in this answer), or
    • MSC, for direct storage access (SD card) as a standard linux device -- if no SD card is in, AFAIK, no extra device will be available to Linux.
  4. Plug your phone's USB cable.
  5. [linux] launch gmtp and click connect. Mind that directories cannot be added, though you can add content to (some of) them.

For a more console-oriented mode, try

$ mtpfs /your/mount/point/

(you need write access on /your/mount/point). Then you can use standard console commands like cp, mkdir, etc. However I couldn't succeed using rsync... more workarounds at the mentioned link. To unmount your phone:

$ fusermount -u /your/mount/point/

sphakka

Posted 2013-06-05T13:44:42.070

Reputation: 147