I am using two main computing devices right now. The first is my 2014 Moto X running the latest Android 5.0 (Lollipop) version. It’s my constant companion and main handheld device. The other is my Dell 13″ laptop running Ubuntu 14.04. I’m not running Ubuntu out of some dislike for Microsoft or Apple. As I’ve written in the past I have used iPads, Android tablets, a Surface Pro, Chromebooks and my work laptop was a 15″ MacBook Pro.
I bought the Dell to use Ubunutu several months ago to use as a development machine, and to force myself to spend more time learning and using Linux. I’m really good managing Windows and Mac boxes after years of doing so but using a Linux machine regularly pushes me to keep learning new things (or at least new to me).
Normally it works great. Since most of my documents and projects are “in the cloud” on Google Drive there’s no need for a native Windows or Mac app. I can sync my Nike Fuelband or Moto 360 watch via my phone, so there’s no need to even connect via USB to it. In that respect it’s just a more flexible Chromebook with a more powerful command line.
However as much as I like my Moto X/Dell combo, for reading ebooks (and the occasional game) I still enjoy a larger screen which is why I have a Nexus 7 tablet. Historically been my default e-reader (most recent books are the Foundation Novels by Asimov and Scaling Up by Verne Harnish). Unfortunately the rate at which Android devices get new updates rolled out drives me crazy. My Moto X was one of the first to get it but I was still waiting to get the OTA update for the Nexus 7. Going back and forth between Android 4.x and 5.0 devices was visually distracting and I wanted the updated experience on my tablet. With some time this afternoon I decided to see if I could sideload the update to the device via USB from my Linux machine.
Intellectually I knew it could be done. USB is pretty straightforward the device connects as MTP for photo and media transfer. Just like a Windows or Mac machine the Nexus presents a file system for you to browse. I also knew, though I haven’t really done any serious Android development, that there was an Android SDK and dev tools for Linux. Unlike iOS you’re not limited to one platform for development with Android. It should just be a matter of getting them installed.
After some quick searches I found some really good articles about how to sideload the updates to your devices, but of course they focused on Windows and Mac. I needed Linux help. I found it at Nic Raboy’s Code blog. He had not only explained the process but had written some scripts to make it pretty easy to figure out.
I won’t repeat all the steps in detail because Nic’s done such a wonderful job of laying it out. First follow this post to use his script to install the latest Android SDK and get it into your path. Next go to Google’s Android factory image page to get the latest firmware for your device. Finally follow his instructions here to install the update.
There were a couple of hitches for me during the process. I would have thought installing the Android SDK tools would also install the
fastboot commands. Those are necessary to connect and unlock the Nexus bootloader. For some reason neither was present when I tried them, but a quick
apt-get install and I was in business. Once I had all the SDK tools in place I kept getting an “waiting for device” error. Nic mentions this in his blog post and suggests using the
sudo command to get around it. That didn’t seem to make a difference for me until I removed the only other USB device I had connected to the laptop, a Logitech receiver for my trackball. I don’t know for sure that was causing a problem but since it was connected before my Nexus, it’s possible there was some USB device detection conflct. Once I removed it everything worked great!
One last thing about the update process that was a really pleasant surprise. Once the firmware had finished installing the Nexus offered me a prompt for a new feature called “Tap & Go”. It allowed me to transfer accounts and credentials from my Moto X directly to the upgraded Nexus via NFC. All I had to do was hold the devices back to back briefly, wait for a tone, confirm my password and then the Nexus just started downloading all my info from the account in the Google cloud. That includes reinstalling all my apps and even putting my favourite wallpaper on the upgraded device!
Now that I’ve got the Nexus upgraded, USB connected and the SDK working, maybe it’s time to fire up Android Studio and play with creating an app with the rest of my rainy day? Would be a good opportunity to dig through the rest of Nic’s blog to see what other Ubuntu + Android development gems he’s discovered.