Friday, September 18, 2015

Linux on your Android phone, easier and more powerful than you think

I had a really good thing going with Terminal IDE on my Android phone. It gave me a basic Unix Environment, which when combined with a Bluetooth keyboard, made accomplishing certain dev tasks a breeze.

Then I got upgraded to Android 5.x and the party stopped. TerminalIDE was rendered useless through the OS change.

A week back I picked up a new phone, a Galaxy Note 5. I hope to do a full review once I've logged sufficient hours. As this was a new phone, I figured I should check on Terminal IDE, maybe there was a work around. Alas, still broken. But it did lead me to GNURoot which promised an install of Linux without rooting your phone. And from there, I made my way to the newer GNURoot Debian.

I kicked off the app and blindly followed the prompts. Sure, I'll make a rootfs. Whatever. Lo and behold, when it was all said and done I was dropped at a bash prompt.

The most basic commands (ls, for example) worked. But anything slightly trickier (vi or ping) came back with a command not found. Was this some sort of toy system? Not at all. I just wasn't thinking big enough. I typed:

  apt-get install vim less

and the result was:

To my amazement, apt-get did its thing and when I was done, I had vim and less at my disposal!

I grabbed more of my favorite utilities: ssh, netcat, curl and subversion. For bonus points I grabbed scsh, the Scheme Shell. Everything pulled down just fine and more importantly, appeared to run just fine:

This isn't like having a Unix Environment on my phone, this is a Unix Environment on my phone.

And I'm apparently still thinking small, folks have gotten LibreOffice and other GUI apps running in this non-root environment. Amazing.

The system isn't without it's glitches. I'm not able to make certain soft links like I'd hoped. And while you can install ping, you don't have the needed permissions to run it. But still, these are minor compared to what actually works and how little effort went into setting this up.

I've not got a shiny new power tool in the toolbox, and boy is it awesome! Let's hope I don't lose a virtual arm to it.

No comments:

Post a Comment