I only started building for iOS within the last year. Since writing my first line of Swift in April, I have shipped three apps to the App Store.
In day-to-day development, I rely heavily on installing freshly built apps straight onto my phone while working remotely or away from my desk. I bounce between two Macs (Work and Home), and when I am out, I often connect back from my phone to have an AI agent edit code and immediately want to test the new build on a real device.
I tried several setups before settling on this one. Early on, I pushed everything to internal TestFlight. It was convenient, except every upload meant waiting several to ten-plus minutes for Apple to process it. Worse, one day I iterated so many times that I hit TestFlight’s testing installation and distribution limit and could not push new builds at all.
I Tried RoamRun, and Hit Two Hard Real-World Blockers
After TestFlight stalled out, I looked into the open-source tool RoamRun. It bridges Xcode wireless debugging from your Mac over Tailscale, and also supports OTA installs and remote screen control. I installed it on both my Work and Home Macs, paired my physical device, tested it thoroughly in my real setup, and eventually gave up on it.
The first blocker I could not work around was networking on the phone itself. My iPhone runs Surge 24/7 because I regularly use the official Claude client. Since iOS only allows one active system VPN at a time, Surge cannot run alongside the official Tailscale app.
At first, I hoped Surge’s built-in Tailscale feature would solve this. I followed the manual and enabled allow-peer-access = true so Macs on my Tailnet could connect inbound, but it still failed. Packet captures and logs finally explained why: the official Tailscale iOS app creates a system-level utun virtual interface, so packets from the Mac enter the iOS kernel with their real source IP and Apple’s wireless debugging daemon remotepairingdeviced responds normally. By contrast, Surge’s built-in Tailscale works as an application-layer proxy: it terminates inbound TCP connections itself and reconnects to the local port from the loopback address 127.0.0.1.
Starting with iOS 17, remotepairingdeviced flatly rejects pairing handshakes coming from 127.0.0.1. We ran a side-by-side test with a real RPPairing handshake packet: connecting directly to port 49152 on the phone’s Wi-Fi LAN IP returned a normal 128-byte reply; routing through Surge’s built-in Tailscale to 127.0.0.1:49152 completed the TCP three-way handshake, then iOS immediately cut the connection with a 0-byte EOF as soon as the app-layer handshake arrived. Surge currently only passes through Apple Screen Sharing on port 5900 without proxying, and has no exception for remote debugging ports, so no rule change can fix it.
The second blocker was even more decisive: a phone is not on Wi-Fi 24 hours a day. Even if I were willing to turn off Surge and switch to the official Tailscale app whenever I needed to debug, RoamRun’s wireless bridge cannot start over pure 5G cellular. iOS only exposes RemotePairing while connected to Wi-Fi. RoamRun’s cellular keep-alive option only keeps an existing bridge alive after it was established on remote Wi-Fi; once it drops or reboots, you need Wi-Fi again. Most of the time when I am out, I am on 5G cellular data, which rules out my primary use case.
There is also a signing-overwrite annoyance. roamrun run and Xcode Run build with an Apple Development certificate and get-task-allow = true, whereas OTA installs use an Apple Distribution Ad Hoc build. The two cannot overwrite each other on the same phone, so mixing them forces frequent uninstalls and reinstalls.
Going Back to Classic Ad Hoc OTA, With a Clean Workflow Around It
After tracing those issues, I first tried RoamRun’s built-in roamrun ota. Because Safari on the phone pulls the build outbound with no inbound handshake, it worked immediately over 5G and alongside Surge. Two practical problems showed up right away, though: roamrun ota relies on a Mac staying awake plus tailscale serve, giving my two Macs two separate entry points; and because Tailscale has no official DERP relays in mainland China, 5G traffic often detours through overseas relays and makes downloading tens of megabytes painfully slow.
Strip away the wrapper, and there is no magic in iOS OTA installation. Under the hood it is just Apple’s decade-old Ad Hoc + itms-services:// mechanism. Anyone who has built iOS apps knows it and can set it up. There is nothing novel about the underlying protocol.
All I did was remove every awkward middle layer: no RoamRun, no Tailscale, no resident daemon on the Mac. The server side is just an existing static HTTPS Nginx site in China. The Mac side uses built-in macOS tools (ssh, rsync, unzip, plutil, security, and xcrun) plus a few hundred lines of Node to archive, verify, and push builds straight to that static host.
I also split daily shipping into two clean tracks:
| Use Case | Tooling | Signing | Best For |
|---|---|---|---|
| High-frequency daily device testing | Self-hosted ios-ota (static HTTPS + SSH/rsync) |
Ad Hoc (release-testing) |
Instant 5G/Wi-Fi installs, no VPN changes, zero TestFlight quota burn |
| Team betas & App Store submission | asc CLI + App Store Connect API Key |
App Store Connect | Skip the web dashboard, separate internal/external test groups and review |
Why Installs Feel Instant on the Phone
The reason tapping Install feels so fast is simple: the .ipa sits on a high-bandwidth server in China for direct download, with no proxy detour and no overseas relay.
I benchmarked pulling a 54.8 MB .ipa from this 200 Mbps server: two consecutive downloads took 1.61 seconds and 1.79 seconds, averaging 30.7 to 34.1 MB/s. Checking the real Nginx access logs, an iPhone on 5G downloading that same 54.8 MB build via com.apple.appstored finishes from HEAD to GET in 1 to 2 seconds. By the time you tap Install and swipe back to the Home Screen, the app icon progress ring is already done.
A Few Practical Gotchas Worth Handling Up Front
Even though the underlying mechanism is old, shipping a dozen builds a day across two Macs gets much smoother once you handle a few details properly.
Verify the signature locally before uploading. itms-services:// rejects both Development builds and App Store signed builds. Before pushing anything, the script extracts embedded.mobileprovision from the .ipa and runs macOS’s built-in security cms -D to check the signing profile type, expiration date, and registered device list. A bad build fails immediately on the Mac instead of waiting until the phone shows “Unable to verify integrity.”
If you want to render the app icon on your install page, the PNG inside an .ipa uses Apple’s proprietary CgBI format, which browsers cannot display. Xcode’s bundled pngcrush converts it back to a standard PNG without installing any extra image libraries:
xcrun pngcrush -q -revert-iphone-optimizations raw.png decoded.png
When multiple Macs share one distribution page, isolate each upload under <bundleID>/<version>-<build>-<timestamp>/. Each release only rsyncs its own build directory and prunes old builds for that single app. At the end, it reads every app’s meta.json on the server to regenerate the shared index.html, then swaps it atomically with mv -f. That way my Work Mac and Home Mac can publish different apps concurrently without clobbering each other.
Because the static site lives on the public internet, I put it behind a 128-bit random URL path, add X-Robots-Tag: noindex, nofollow, noarchive in Nginx to block indexing, and return 404 for all *.json metadata files so build details stay private. Each app only keeps its last few downloadable .ipa binaries while pruning older payloads and keeping the history entries, so disk usage barely grows over time.
Daily Flow With T4 Code and a Home-Screen Web App
After wrapping both this OTA script and App Store Connect releases as Agent Skills, I rarely have to remember or type commands myself.
Now that I use T4 Code, I can control both my Home Mac and Work Mac from my phone wherever I am. No matter which machine edits the code or builds which app, the output lands on the same ios-ota static distribution page.
I do not even need the agent to paste an install link back into chat. I opened the distribution page in Safari on my iPhone and iPad and tapped “Add to Home Screen,” giving me a regular-looking icon right on the desktop. Whenever an agent finishes a build and says it is published, I tap that web app, tap the latest version, and overwrite the app in place in tens of seconds, regardless of network or proxy rules.
Clear Trade-Offs: Not for Remote Debugging
To avoid setting the wrong expectations, here is what this setup cannot do.
The biggest limitation is zero remote device debugging. It only gets builds onto your phone as fast as possible. Unlike RoamRun, it cannot bridge Xcode to a remote physical device. Your Mac cannot attach to the phone, read live os_log streams, hit breakpoints, or let an agent inspect a crash directly on the device. For crashes or hard-to-reproduce bugs, you still need in-app logging or a cable back at your desk with Xcode.
If you genuinely need remote debugging while away from your Mac so your computer can attach directly to your phone and inspect failures live, static OTA is not the right fit—you should invest in getting a wireless debugging bridge like RoamRun working instead.
Ad Hoc itself also comes with Apple’s fixed rules: each paid developer account can register at most 100 test device UDIDs per membership year, and every new device needs Developer Mode enabled in Settings before its first install. It is meant for your own devices and a small core test group; external beta testers still belong on TestFlight.
For me, any gnarly bug that genuinely requires breakpoints is something I am going to sit down at my Mac to investigate anyway. When I am away from my desk, almost everything I want is simply to drop the latest change onto my iPhone or iPad and see how it feels. Making that single loop instant over 5G, network-agnostic, and completely free of Surge conflicts is more than enough.