The other day I read Giving the iPad a full-time job by Justin Searls, a prominent developer in the Rails community. He discusses the benefits of using the iPad Pro instead of a full fledged windowed operating system as a workstation.
I set out to try it myself a few weeks ago, and recently started feeling comfortable and productive. I wanted to share what I’ve learned in making this a viable option for developing on the go.
Things you’ll need
An “always-on iMac”
So… this is basically the “gotcha” moment, and I figured I’d get it out of the way as early as possible:
In order for this to work you need your own machine running macOS / Linux that you can tap into remotely. Whether that is having an “always-on iMac” in your basement, or setting up a cloud service like Linode or DigitalOcean.
Unfortunately, iOS does not yet provide any sort of Terminal to access the UNIX architecture that it relies on.
This article will focus on setting up a Mac running High Sierra for use with your iPad Pro because that’s the solution that was available to me.
An iOS shell
Searls recommends using blink shell. It’s twenty bucks on the app store or you can build it from open source.
It supports remapping keys (
OPTION), custom styling using
@font-face, split-screen mode in iOS, and
comes with ssh/mosh pre-installed.
Mosh aims to be a friendlier version of ssh (which it relies on) that is more responsive and gracefully handles dropping a network connection or switching networks. You’ll need to install this on your Mac. It comes preinstalled with blink shell.
Things you might want
I purchased macOS server to set up a VPN. This allowed access to my local
network without leaving ports
22 wide open for all of the internet to
Configuring your internal network
Option 1: Port forward all the things
Most modern routers have the ability to set up port forwarding. This involves defining rules to forward requests made to specified ports on your router (aka requests to your external IP address) to ports on a machine connected to the router’s LAN or WLAN services.
For example, you can tell your router “Hey, take any incoming requests we
receive on port
22 and forward them to this machine on my local network
please. To do this, you’ll need to know your Mac’s internal IP address.
You’ll need to port forward:
- TCP port 22 for ssh.
- UDP port(s) in the
610000range for mosh. Mosh logs in via ssh, then starts a connection on a UDP port between
- TCP port
80if you want to access applications hosted on your machine.
Option 2: Set up a VPN
A VPN seemed a little more secure to me. I wouldn’t have to forward port
22 directly from my external IP address to my Mac. Instead I would only
have to open ports used to connect to the VPN service, which would require the
knowledge of a shared secret key.
Give your Mac a static IP address
Giving your Mac a static IP address will prevent your setup from possibly breaking if your Mac reconnects to your local network.
System Preferences and choose the
Network option. Once there, click on
your WiFi or LAN connection and click the
Advanced button. A new window will
slide over. Choose the
TCP/IP tab and set the
Configure IPv4 to
with manual address and then enter your desired IP address into the
Address text box.
Make sure to choose one that is unlikely to be used by other local devices or your VPN connections.
Port forward ports required by the VPN service on your router
You’ll need to port forward the following ports on your router to your Mac in order to use a macOS Server VPN on High Sierra:
Configuring macOS Server VPN
I would start by reading Apple’s macOS Server documentation regarding setting up a VPN.
My current VPN settings are as follows:
- VPN Host Name: I set this to my external IP address.
- Client addresses: You can set aside however many IP addresses as you see fit for incoming VPN connections. I used the same first three numbers as my internal IP address and chose a relatively high number for the last number in order to secure IP addresses that would be unlikely to be used.
- DNS settings: I added the three DNS IP addresses that were recommended by my ISP here. You could also use something like Google Public DNS.
Open access to ports required for SSH, VPN, and mosh on your Mac
You’ll need to open the following ports in your macOS Server
22(TCP for SSH)
4500(UDP for VPN)
60000-61000(UDP for mosh - you don’t need all of these. Just set aside a few in case your blink shell crashes and you need to reconnect to your shell on a different port)
22 and ports in the
60000-61000 range are only open to those
connected to your internal network, and port
80 doesn’t need to be opened at
Pass along your VPN configuration to your iPad Pro
Once your VPN is set up satisfactorily, click the
Save Profile... button at
the bottom of your VPN settings. This generates a file that will automate
setting up a VPN connection on your iPad Pro. I saved this to my
folder which I have access to on my iPad Pro via the Files app and iCloud.
Connect your iPad Pro
Connecting to the VPN should be as easy as opening the VPN configuration generated in the last step on your iPad and logging in using your Mac account’s credentials.
Configuring Blink Shell
With mosh installed on your Mac and either Option 1 or Option 2 set up, you should be ready to mosh into your Mac’s terminal from your iPad using blink shell.
Open blink shell and enter the
config command. This should bring up the
Add a new entry in the “Host” section and set the following:
Host: whatever you want to refer to your Mac/VM as
HostName: your external IP address
User: your username on your machine (run
Password: your password to unlock your Mac (or you can require it to be entered each time)
Server: the result of
which mosh-serverin Terminal
Port: whichever port in the
61000range that your forwarded on your router (Option 1) or opened on in macOS Server (Option 2).
From here, you should be able to run
mosh <Your entry for Host> and tap into
your Mac’s shell. If you chose the VPN route, you’ll need to be connected to it
if you’re not on your the same WiFi as your Mac in order for this to work.
Otherwise, VPN’ing is not necessary.
Reach apps hosted locally on your Mac
As a developer you may be running several apps on a loopback interface known as
127.0.0.1). After fumbling with this for a long time, I have
learned that you simply cannot access localhost from a another machine.
What you can do is host apps on all interfaces by hosting them on
127.0.0.1. In fact,
rails server (as of version 4.2) binds to
0.0.0.0 by default instead of
So for example, say you have a Rails app running on
0.0.0.0:3000, and you are
connected to your newly configured VPN. You can now view that app
on your iPad using your Mac’s internal IP address, i.e.
Accessing apps hosted with Pow
If you use the Pow rack server to host your Rails apps, you can find out how to access them on your iPad by leveraging xip.io in the Pow User’s Manual.
I think the iPad Pro gets you most of the way there if you like to use a UNIX heavy workflow like vim, tmux, and git’s command line interface. I am happiest when I can rely on the Terminal as much as possible, so this setup is pretty sufficient for me. If you like to use a GUI based editor or IDE, I think using this set up might be a pain unfortunately.
Unsurprisingly, there are some things that macOS or a full operating system currently do much better.
- If you work heavily in the frontend, you’ll really miss having access to browser developer tools and extensions. You can use the Firebug Lite Bookmarklet, but its a pretty sad replacement for Chrome or Firefox loaded with React, JSON, and Ember extensions.
- If you pair program frequently using a screen sharing application, then you may want to consider using tmate to share your shell session instead.
- If you frequently open URLs with
powder open, or command clicking a link in iTerm2 you’ll be out of luck since these will still open a browser on your Mac at home.
- If you rely on some really handy Mac applications, then you’ll find yourself having to use workarounds. Some nice side effects of having to to so is that you’ll be forced to become more proficient using UNIX tools on the command line. For example, I’ve become much better at using HTTPie when I don’t have Paw at my fingertips (although I still miss and love Paw dearly and hope they release an iOS app soon).
I think the iPad Pro is four steps away from being a viable stand-alone workstation for everyone:
- Open up access to the UNIX underbelly of iOS by providing a Terminal.
- Provide access to a robust file system for the iPad.
- Allows iOS browsers to include developer tools and make uses of extensions.
- Build Xcode for iOS.
Until those four things are incorporated into iOS causing it to morph into a iOS/macOS hybrid, I think the practicality of giving your iPad Pro a “full-time job” will largely depend on your day-to-day. However, if you want to use your iPad as a nice change of pace or for lighter tasks it can be a really fun way to break up the monotony.