Coding on iPad using self-hosted VSCode, Caddy, and code-server
tailscale.com
tailscale.com
I sometimes wonder if the ipad was made just for this pun to eventually become reality.
https://apps.apple.com/de/app/codebrew-ide-for-java/id647526...
But can a linter run locally? That would be nice I guess.
Also since so many languages target WASM nowadays, could an IDE at least compile to that, and then run some tests locally?
If a hammer didn’t have the “artificial constraint” placed on it of missing a standard slot head or Phillips head driver (and hammer manufacturers can clearly install them if they chose to) it could be a more multi-use tool than just a hammer. Likewise, screwdriver manufacturers would only need to add a hard striking surface to their tools for them to be also used to drive nails too.
I had a multitool hammer/screwdriver combo once. It sucked as both a hammer and a screwdriver and I found myself always reaching for my actual hammer for driving nails, or screwdrivers for driving screws.
There is no reason(except greed) for why an iPad has to be locked down.
Seems to me the big complaint is not that you can’t write code on it, but that it doesn’t run MacOS. But that brings me back to the original intent of the product—It’s form factor is designed for information consumption and only recently with the introduction of the M-chips on the device, it would have made a pretty shitty MacOS device in prior versions.
So recent tech has improved the screwdriver so that it could be used effectively as a hammer too, but I don’t think you can realistically say it was greed that caused Stanley tools to create both hammers and screwdrivers before the tech changed to combine them. They were two separate tools because they needed to be.
Uh, the App Store guidelines?
>it doesn’t run MacOS
No, it doesn't, but they both run XNU and share a huge amount of their userspace. If someone was clamoring for AppKit on iPad, yeah, you'd be correct in saying that's a silly request, but macOS and iOS are for most intents and purposes the same, aside from the artificial limitations placed on the latter to protect App Store profits. 1-hour of battery life / Wh of battery capacity between the last iPad Pro with an M2 and the M2 Macbook Air are pretty close too, its not like the limitations are there solely to save battery life since macOS with is yucky icky energy hog background tasks and spoooOoOOOky applications that haven't had their code inspected by Apple and might be able to do maniacal things like read the filesystem don't tank the battery life that much after all. (52.6Wh in the MBA for 12 hours of browsing, vs 40.88Wh in the old M2 iPad Pro 13" for 10 hours). Of course these are very different kinds of devices with very different feature sets, but minus a touchscreen and OLED, plus a hardware attached keyboard and trackpad, what are the actual material differences, not vague market segmentation, between a Mac and an iPad?
If the iPad is only for content consumption, why does Apple sell one that stock is better than most of the Macs they sell? Why does Apple market and position the iPad Pro as a content creation device, why do they bother adding content creation features and multitasking improvements and so on to iPadOS, if it is not meant to be a content creation? If it is meant for content creation, why is it only the content that can be created in ways Apple deems allowed for the device you bought from them?
The expectation that Apple should now consider the device and tune its software and OS to SWE is a pretty bold expectation. Frankly, most devs I know wouldn’t use the device for hardcore dev even if it ran MacOS. It would be useable for those few moments when you would not be behind a desk and need to code, emergency fixes and the like. Pretty sure Apple’s product team knows this and are not all that worried about that use case.
Sadly, one discovers dozens of minor bugs and annoyances, that are mostly specific to doing productivity/dev work.
For example, when I use Cmd-Tab to switch tasks, there’s a ~ 1/20 chance that the Cmd key will become ‘soft-stuck’. That is, I’ll start typing and the OS will act as if I’m holding down Cmd, often messing with my browser or active project. I have to tap Cmd again to ‘unstick’ it. It’s not a hardware issue- An Apple store has already replaced the keyboard for me, and the problem persists.
I guess no one at Apple dogfoods the iPad for productivity? Which is sad, because here this thing is! It exists! Productivity features have been at least added to iOS!
On the plus-side, I’m getting deep into doing sound synthesis / music production in iOS. The ecosystem is kind of exciting. I spend most of my time inside Audulus (Max/PD-like data flow/DSP) - it is criminally underrated, and so much fun.
I could really go on about the pros and cons but will refrain. It’s just such a mixed bag.
Rich text editor, run PHP and NodeJS on device, manage Git repos, and view your projects in a built-in browser that includes dev tools.
Check it out! https://apps.apple.com/us/app/webforge-ide/id6450872424
EDIT: Web Development IDE, not web-based IDE. Thanks for pointing that out! :)
Now, getting PHP and NodeJS to run on device was quite the ordeal...
Apple has intentionally dumbes down the iPad. It’s sad…
Edit: F keys as in F1-F12
iPadOS was born out of iOS. Why would iOS build support for F keys? F keys themselves are a hold over from quite a while ago. Apple tied to repurpose that space on the laptop with the old Intel MacBook Pros. When building a new OS, with a new software keyboard without F keys, why would they spend time developing around something that didn’t exist? When adding keyboard support, why would they add support for keys that don’t exist on the software keyboard?
I can see where that would be low on the priority list. I don’t think anyone at Apple had F keys working, then actively deleted the code to handle it while laughing maniacally.
Modifier keys (Caps, Ctrl, Opt, Cmd, Globe) on Magic Keyboard can be remapped in Settings.
SecureShellfish (ssh client) has a keyboard bar, support for Function keys.
https://vscode.dev can connect to a remote vscode instance in a container e.g. over Remote Tunnels ; but browsers trap so many keyboard shortcuts.
Which container with code-server to run to connect to from vscode client?
You can specify a development container that contains code-server with devcontainer.json.
vscode, Codespaces and these tools support devcontainer.json, too:
coder/envbuilder: https://github.com/coder/envbuilder
loft-sh/devpod: https://github.com/loft-sh/devpod
lapce/lapdev: https://github.com/lapce/lapdev
JupyterHub and BinderHub can spawn containers that also run code-server. Though repo2docker and REES don't yet support devcontainer.json, they do support bringing your own Dockerfile.
As a result, unfortunately the F1 keyboard shortcut calls browser help not vscode help.
Aren't there browser-based RDP apps that don't mangle all of the shortcuts, or does it have to be fulscreen in a browser to support a VM-like escape sequence to return keyboard input to the host?
VSCode, I dunno. It is nice to be accessible. It seems like a poor replacement for tmux+vim, which runs happily over bog standard ssh.
I do miss the aspect ratio though.
It also has some integration with the "files" app to transfer files in and out of your shell session.
Edit: and I've got a cron job checking on a web site that will send a notification if has changed to my watch via the secure shellfish "notify" command.
A laptop in portrait mode _is_ quite awkward. Did you mean to say landscape, or are there people out there propping their laptops up on their sides?
I got a convertible 2-in-1 laptop (in 16:9) after the iPad experience, figuring it would be similar. It really surprised me, after using the iPad, how much I dislike the laptop in portrait mode.
Good point, though, a totally typical (aka not convertible) laptop would be more or less impossible to use in portrait mode. Sorry for the confusion.
I've gotten usable sessions doing Lean or Agda programming that way and they rely heavily on unicode input (handle by vim) and interaction with language servers. But I still prefer an actual keyboard and larger screen for anything serious.
I'm using "shellfish" for ssh connections. And I use "working copy" by the same author for browsing source code on the go.
> There are a few caveats to coding on an iPad.
Well, thanks for being specific...The major issue is that apps & tabs are evicted unexpectedly. Any time you content switch, the app has a chance to be killed.
Of course there are mobile terminals , tmux and other tools to mitigate it, but it's still a major pain.
If I'm going ultra-light, I carry a raspberry pi + bt keyboard . Otherwise a laptop is preferred.
It turns out that keeping your app state in ram is very useful.
Split screen can reduce eviction. Textastic combines editor & ssh client, which can reduce some context switching.
Also interested how it handles when network is lagging. Is the input laggy or does it smooth on the client and it syncs once network stable things sync?
"Terminals are not available in the web editor. Continue in an environment that can run code, like a codespace or VS Code Desktop."
Which makes me want to integrate it with a Linux in the Browser...?
Serveditor is the one I’m thinking of. Not sure if it is still around or not. There were paid plans for them to host your backend, or it was free if you had your own server.
[1] https://github.com/ipv6rslimited/cloudseeder </shameless>
I’ve just been hating siting at a desk for any period of time. I can’t figure out what it is about a desk. Maybe it’s an adhd thing?
Luckily I don't use an IDE (just Vim) so my solution has been to take my laptop to different places, sometimes around the house and sometimes outside. A coworking space a couple days a week seems to help a lot too.
I particularly like goodnotes, for example.
And the ipad is pretty light… if i could use a proper terminal (with all the keys working, including F1-F12) i might ditch my laptop… i messed a bit with remote desktop via rdp and it’s quite usable - worked okay when i tried it on a bus driving on a highway at ~110 km/h over a 4g connection).
So yeah i could still access a full linux desktop either via ssh (shelly) or via rdp (via the Microsoft rdp client)
if you're like me and continually open new apps and browser tabs, never closing them, then one benefit of using iPad versus mac is the OS process lifecycle. iPad/iOS processes that are not in focus go into background/suspended state, and don't make your ipad slower and slower - whereas on mac you need to be a bit more disciplined, or else ...
The 13" MacBook Air is 1.24kg (or 1,240g) according to Apple's tech specs.
From what I can find[0] the comparable iPad Pro 13" with Magic Keyboard is 1,246g.
So for someone who uses the keyboard all the time, which I expect to be the case for anyone using it for coding, the iPad with Magic Keyboard is heavier than a laptop, technically speaking. Functionally, they are the same weight.
I remember seeing that a previous version of the iPad + keyboard was both thicker and heavier than a MacBook Air. Unless someone is going without a case, and only using the Apple Pencil (or their fingers), the iPad is not the thin and light option it's sold as.
Going with a form factor that makes sense is the important part. Will the user actually use touch or the pencil? Will the keyboard always be attached? Where and how will it be used? I personally find an actual laptop works much better in a chair or couch than an iPad, if trying to use a keyboard. When using an iPad with a keyboard, I feel like I'm stuck working on a hard flat surface of some kind.
[0] https://9to5mac.com/2024/05/13/m4-ipad-pro-magic-keyboard-we...
The other issue with an ipad and coding is weight distribution. Tablets are too top heavy to work well in a clamshell setup if that's how you're going to use it.
What is the actual use-case of this?
Am still surprised there isn’t a solution to make the iPad a real dev machine.
Apple must really not want us to do this.
On Android, OEMs and App developers play tricks to hack those restrictions and you end up with awful user experience and poor battery life.
If apple loosens background restrictions to allow for IDEs, compilers, terminals and any app that needs to keep a socket or child process alive -- an entire league of background battery-killers will hit the app store
This is a case of Apple discipline in favor of the iPad platform.
Apple could even support switching the iPad into a desktop mode, which would be real macOS. Could be similar to how the Steam Deck switches to KDE.
I suspect the real reason is Apple wants the iPad to remain a consumption device so they can sell you more than one device.