Move some photos you took with the camera from the gallery to your laptop (using MTP)

Bug #1322064 reported by Brendan Donegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Autopilot Tests
In Progress
Undecided
Brendan Donegan

Bug Description

Prerequisites: Some photos need to be available in the gallery. The phone needs to be connected to a computer through its USB port.

1. (On the laptop) copy the contents of the Pictures folder on the phone to the same directory on the laptop.

Related branches

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This is going to be tricky as we need to make the other end (the 'laptop') transfer the files.

Changed in ubuntu-autopilot-tests:
assignee: nobody → Brendan Donegan (brendan-donegan)
status: New → In Progress
description: updated
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

We might just be able to use ssh

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

phablet@ubuntu-phablet:~$ ssh brendand@192.168.1.67 "find \$XDG_RUNTIME_DIR -name 'Nexus 4'"
brendand@192.168.1.67's password:
/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C008%5D/Nexus 4

ssh brendand@192.168.1.67 "cp '/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C008%5D/Nexus 4/Pictures/*' '/home/brendand/Pictures/"

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Looks like it's not possible just to copy files from here, but we need to go through an API or something.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

for file in `ssh brendand@192.168.1.69 "ls '/run/user/1000/gvfs/mtp:host=%5Busb%3A003%2C088%5D/Nexus 4/Pictures'"`; do ssh brendand@192.168.1.69 'cp /run/user/1000/gvfs/mtp:host=%5usb%3A003%2C088%5D/Nexus 4/Pictures/$file' '/home/brendand/Pictures/'"; done

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Actually this is the correct command to do the copy:

ssh brendand@192.168.1.69 "cp '/run/user/1000/gvfs/mtp:host=%5Busb%3A003%2C098%5D/Nexus 4/Pictures/image20140701_0001.jpg' '/home/brendand/Pictures/'"

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

List and copy:

for file in `ssh brendand@192.168.1.69 "ls '/run/user/1000/gvfs/mtp:host=%5Busb%3A003%2C098%5D/Nexus 4/Pictures'"`; do ssh -tt brendand@192.168.1.69 "cp '/run/user/1000/gvfs/mtp:host=%5Busb%3A003%2C098%5D/Nexus 4/Pictures/$file' '/home/brendand/Pictures/'"; done

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Full command now:

MTP_DIR=$(ssh brendand@192.168.1.69 "find \$XDG_RUNTIME_DIR -name 'Nexus 4'")
for file in `ssh brendand@192.168.1.69 "ls '$MTP_DIR/Pictures'"`; do ssh brendan
d@192.168.1.69 "cp '$MTP_DIR/Pictures/$file' '/home/brendand/Pictures/'"; done

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Hi Brendan. I think you've done an awesome job... But: this being a UX test, I think this case should be tested at the UI level, and not at the (file)system one. To me the test would be:

1. Connect the phone to the desktop.
2. Check that the Phone icon appears in (desktop) Launcher.
3. Open the Phone icon.
4. Check that the File managers opens the Phone.
5. Go to the Pictures folder.
6. Copy the photos.
7. Check that the photos has been copied.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

@victor: in that case we are not testing the desktop and the details about the phone icon and file manager are not important for the moment. The device being recognized as an mtp device by gvfs, and the file not being corrupted during the transfer are good enough for our scope of testing.

The PC side of the world can be added as future variant of this test case.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.