Web development with nothing but a phone and a keyboard
Recently I started a gig where I was handed a laptop and told I should take it home with me at night. Now this isn't the worst thing ever but I was already carrying one laptop with me (my personal/work laptop as opposed to the one given to me by the client). So now my backpack has 2 full-size MacBook pros in it and they're not too light when you start stacking them up. Throw in a sweater for the freezing office, a charger for the laptops and the occasional book/snack/other item and suddenly my backpack is crazy heavy! I felt like I was in high school lugging around all those textbooks again. So I decided to do something about it. I was carrying this stuff around like somebody who's not an engineer!
The first thing I decided to do was take care of the client laptop. It took a while but I finally got a locker so I don't have to carry that one home with me. That's a big relief. No more responsibility, no more risk, and no more back pain. But while I was at it, there's a bunch of other stuff I could get rid of. I started emptying out my bag. Old credit cards, gum, laptop accessories, they can all go. But that left the biggest thing; How do I get rid of my personal laptop? I use it for so much. I use it for taking notes, and chatting, and doing some dev work and research on the side... Hard to replace all that functionality and power at my fingertips.. Or is it?
I think I was over-engineering my life. My phone actually has way more power than my first couple desktop computers. Surely it can handle some text editing..
I started putting together a list of what I use my laptop for. That turned out to be a pretty freakin' long list and I had to cut it short. But then I started listing just the things I use it for while at work. That turned out to be a much smaller list! Despite my best efforts, I don't really do that much real programming on my personal computer at work. Nor do I do video editing, gaming, run docker
swarms, sed
, awk
, grep
, or simulate various hardware environments. Sure, I do all those things once in a while but not terribly often and things like research I can generally do on the client's machine. Don't get me wrong, I do these things all the time at home or at my company's office but almost never while at the client. As it turns out, most of what I do on my personal machine at work is listen to music, chat with coworkers over Slack, and take notes in Evernote. When you break down my spread of activities over time and how often I do each of them, it became pretty apparent that I don't spend enough time on my personal machine to justify hauling it all over town hurting my back and risking theft.
It was like Occam's razor for my backpack. It turns out the simplest solution was just to not carry all that shit around with me.
Replacing the lost functionality is pretty easy for common operations. I already had Slack, Chrome, Evernote, and various chat and music applications installed. That covered about 80% of what I use the machine for. Those activities presented a unique challenge though; While I can easily take notes on my phone, typing them out on the tiny screen is really really hard! I needed a keyboard. A real keyboard where I could type at full speed, tab between chats, and just generally not lose any of my productivity to the tiny screen. I opted on a whim to purchase Apple's Magic Keyboard since I knew it would be fully compatible with my iPhone 7+ and I could use it with other computers in the future if I so choose. It also helped that there's an Apple Store in the same building as me making popping downstairs to buy one all-too-convenient.
Getting the keyboard set up was a breeze. It's a pretty standard Bluetooth device and it's decently responsive. I had it connected to my phone in a minute. The thing that I didn't expect is that after getting things set up I tried immediately to cmd+tab
my way into an application like I had seen online. Not so fast! As it turns out, you're not really expected to try and use a phone as a powerful device; You're only expected to use the iPad that way. So a lot of the fancy keyboard shortcuts available to iPad users are not available to the iPhone including tabbing between applications and double-tapping the home button. What you can do, though is hit cmd+space
to bring up spotlight search. It's not quite as efficient but I can switch apps without taking my hands of the keyboard which is all I really wanted. Another useful trick is that you can power on your phone as if you had hit the home button by tapping any key on the keyboard. Tap the key again to bring up the passcode screen and enter your password on the keyboard to unlock. That way you don't even have to move away from the keyboard to unlock the phone!
I wanted to replace all the power and developer tools that my laptop offered me.
This turned out to be way harder. I couldn't just pair my keyboard to an "iTerm2 Phone Edition". IOS is a pretty locked-down operating system so you're going to have a hard time doing things like installing node and running a web server. Instead, I decided to go the way of the millennial and offload my needs to the cloud. I'm already keeping documents, videos, photos, social media, and all sorts of other stuff in the cloud, why not my local development environment too? There's a couple apps you can use to do some local development on iOS but they're all very limited in one way or another. When it comes to development, I'm willing to deal with a small screen and a requirement for a network connection but limiting what I can do over that connection is not acceptable. So cloud it is. I chose to use AWS since I already have an account there and they provide far more services and functionality than I need. I spun up an Ubuntu box in AWS and enabled an SSH connection from just my current IP address. The last thing I needed was a way to connect to it. Enter Termius. It's an application that provides a simple way to SSH or Telnet into any remote machine and it runs on iOS. It also supports logging in with an SSL keypair instead of a password which is how AWS expects you to work. After a couple minutes of setup, I was in!
You can see my first login in the screenshot above. From here I can install node, run and edit scripts and hack 'til my heart's content.
You can ditch your laptop for your phone too. All you need is an external keyboard.
I'm doing it right now! I wrote this blog post in Evernote on my phone in about half an hour. I didn't have any problems typing or formatting. Now, to be fair, I did still have to go back to my laptop to publish it because the scripts that generate the site live there but now that I've got everything else set up I'm going to be moving my blog scripts to AWS as well. I hope this inspires somebody else to ditch the brick and get into super light-weight development.