1

What is the best way to connect a Nexus 7 by USB and transfer files to/from Ubuntu?

I had a bit of a fiddle with mtpfs but didn't get very far as it seems to hang when I connect the device. I have Ubuntu 12.4 and 3.8 kernel.

I see there is this previous question, but there was no answer: https://askubuntu.com/questions/253562/nexus-7-usb-problems

fig
  • 200
  • 1
  • 3
  • 11

1 Answers1

2

If you're ok with using the command line, I would install adb, the Android debugging bridge. It's reliable and simple to use, but may be a little off putting for new users.

(http://androidforums.com/lg-spirit-4g/692656-install-adb-windows-ubuntu-12-04-12-10-a.html)

You will need to enable developer options on your Nexus 7 by tapping 7 times on the Build Number item in Settings -> About Phone. This will enable a new option, Developer Options, from there enable USB debugging.

When you're connected via USB, with adb you can verify that adb can see your device with;

adb devices

You should see the following;

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
XXXXXXXXXXXXXXXXXX device

Where XXXXX is an alpha numeric string unique to your device. If you don't see the string, you haven't configured adb correctly.

You will be able to transfer files to your device using adb push

adb push myfile /sdcard/

and get files off using adb pull

adb pull /sdcard/remotefile /home/username/
theintern
  • 364
  • Hmm, there's a lot of fiddling around in that link, which I was trying to avoid. I found another link that claims to install adb cleanly via a new ppa: http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html - but unfortunately adb devices doesnt find the Nexus having installed it. I know the device is alive because the old mtp method can see the filesystem (albeit with usual freezes/hangs etc). I may try this again in a few days... – fig Oct 20 '13 at 15:47
  • OK, so it turns out the missing step was that I needed to "enable USB debugging" on the Nexus 7. Having done that I can now see the filesystem OK, and things seem snappy. However, when I try a "pull" I either end up with 0 bytes or a corrupt truncated file :-( – fig Oct 20 '13 at 21:36
  • I'm gonna accept the answer anyway because there are no others and I want the 2 points! – fig Oct 28 '13 at 17:56
  • adb is now available from the default Universe repository so we can install using sudo apt install adb – mchid Dec 13 '20 at 15:52