<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rizwan - iOS Developer</title><description>iOS developer writing about Apple platforms, AI-augmented workflows, and open source.</description><link>https://rizwan.dev/</link><item><title>AI Agents - Close the loop for mobile apps</title><link>https://rizwan.dev/blog/2026-01-18_ai-agents-close-the-loop-for-mobile-apps/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-01-18_ai-agents-close-the-loop-for-mobile-apps/</guid><description>Implementing AI agents to enable autonomous decision-making and action loops in mobile applications</description><pubDate>Sun, 18 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;The Loop That Actually Ships&lt;/h2&gt;
&lt;p&gt;Most app flows are linear: a user does something, the app responds, and we stop. Agents break that line and turn it into a system that watches, decides, and tries again until the goal is met.&lt;/p&gt;
&lt;h3&gt;Diagram&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;Goal
↓
Sense → Decide → Act → Measure
↑ ↓
└─────────── Update ────┘
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the loop closed, you get:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tasks that finish without constant prompts&lt;/li&gt;
&lt;li&gt;Recovery paths when something fails&lt;/li&gt;
&lt;li&gt;Behavior that adapts as the environment changes&lt;/li&gt;
&lt;li&gt;Less manual babysitting&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Mobile-Specific Challenges&lt;/h2&gt;
&lt;p&gt;Mobile is different. In web or backend work, you can simulate most behavior locally. On mobile, the real device matters. Cameras, sensors, thermal throttling, permissions, and OEM quirks are hard to fake. That makes the loop slower because humans end up doing the device-side validation.&lt;/p&gt;
&lt;p&gt;Closing the loop on mobile means connecting the agent to real hardware and real state. For Android, that often looks like direct access to ADB so the agent can install builds, drive the UI, capture logs, and verify what actually happens on the device.&lt;/p&gt;
&lt;h2&gt;A Real Example&lt;/h2&gt;
&lt;p&gt;I was debugging a camera focus issue in an Android app. My old workflow was:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ask a coding model for a fix.&lt;/li&gt;
&lt;li&gt;Build in Android Studio.&lt;/li&gt;
&lt;li&gt;Run on device.&lt;/li&gt;
&lt;li&gt;Reproduce manually.&lt;/li&gt;
&lt;li&gt;Repeat.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It worked, but it was slow and repetitive.&lt;/p&gt;
&lt;p&gt;So I asked if the agent could verify its own changes. Once my device was connected over USB, it could run ADB commands to install builds, start the app, drive the camera flow, and capture outputs. I let it run for a couple of hours while it tried different hypotheses.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hey, can you test this on the real device USB connected? Run whatever ADB commands you need, keep iterating until it works, and write every attempt plus screenshots into a md log file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The result was a detailed markdown log of every experiment, complete with screenshots and what changed between attempts. I still had to steer it a few times, but it eventually found the root cause and taught me a lot about CameraX and Camera2 along the way.&lt;/p&gt;
&lt;h2&gt;Why This Matters&lt;/h2&gt;
&lt;p&gt;The compounding benefit is speed and rigor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The agent can execute more experiments than I can in the same time.&lt;/li&gt;
&lt;li&gt;Every attempt is logged, so the learning is reusable.&lt;/li&gt;
&lt;li&gt;The loop closes on the real device, not just on a simulated environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is what makes agents powerful for mobile: not just code generation, but autonomous testing and verification on actual hardware.&lt;/p&gt;
</content:encoded></item><item><title>I Stopped Reading Every AI Diff</title><link>https://rizwan.dev/blog/2026-07-23_i-stopped-reading-every-ai-diff/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-07-23_i-stopped-reading-every-ai-diff/</guid><description>On iOS, agent PRs used to mean simulator time and line by line review. Claude Code and closed loops moved that habit.</description><pubDate>Thu, 23 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I used to treat every agent PR like untrusted code.&lt;/p&gt;
&lt;p&gt;Read the full diff on GitHub. Build in Xcode. Run the simulator or a real iPhone. Tap through the flow myself. Check tests. Only then approve.&lt;/p&gt;
&lt;p&gt;That made sense when the models still missed UIKit lifecycle, SwiftUI focus, or half the scheme setup. On mobile you cannot fake the device. If it does not run, it does not ship.&lt;/p&gt;
&lt;h2&gt;What I do now&lt;/h2&gt;
&lt;p&gt;Models got better, and I got pickier about the loop around them.&lt;/p&gt;
&lt;p&gt;I still care that it builds, runs on a device or simulator, and that the PR shows proof. Before and after screenshots. A short note on what changed. Tests green. Claude Code babysits the PR: AI review comments come in, it fixes them, pushes again.&lt;/p&gt;
&lt;p&gt;Most days I glance the diff, look at the screenshots, skim anything touchy (permissions, Keychain, networking), and approve.&lt;/p&gt;
&lt;p&gt;I still dig in when it can hurt users: auth, payments, migrations, anything with private API smell. The doubt did not vanish. It just stopped living on every line of Swift.&lt;/p&gt;
</content:encoded></item><item><title>Field Report: macOS VMs in 2026</title><link>https://rizwan.dev/blog/2026-09-28_macos-vm-field-report/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-09-28_macos-vm-field-report/</guid><description>What is available for renting macOS machines today, what it costs, and why Apple&apos;s license makes it so much pricier than Linux.</description><pubDate>Mon, 28 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Linux VMs are a solved problem. You ask for one, it boots in seconds, you pay by the minute, you throw it away.&lt;/p&gt;
&lt;p&gt;macOS VMs are not there yet. This is a quick field report on where things stand as of September 2026.&lt;/p&gt;
&lt;h2&gt;Apple&apos;s restrictions&lt;/h2&gt;
&lt;p&gt;The reason is not technical. It is the &lt;a href=&quot;https://www.apple.com/legal/sla/docs/macOSTahoe.pdf&quot;&gt;macOS software license&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Apple hardware only.&lt;/strong&gt; macOS is licensed &quot;for use on Apple-branded Systems&quot;. No running it on a regular x86 or ARM cloud server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs per Mac.&lt;/strong&gt; You can run up to two additional macOS copies in VMs on a Mac you own or control, for development and testing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;24 hour minimum lease.&lt;/strong&gt; A hosting company can rent out a Mac for developer services, but the whole machine goes to one customer for at least 24 consecutive hours. Apple added this in the &lt;a href=&quot;https://9to5mac.com/2020/11/11/macos-big-sur-adds-leasing-terms-that-pull-hosting-services-like-macstadium-out-of-a-legal-gray-area/&quot;&gt;Big Sur license&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So a provider cannot slice one big server into dozens of short lived VMs for different customers. Each Mac is bought, racked, and handed to one person for a day at a time. Once your job finishes after ten minutes, the provider still has to account for the other 23 hours and 50 minutes.&lt;/p&gt;
&lt;p&gt;That is why Linux is cheap and macOS is not.&lt;/p&gt;
&lt;h2&gt;Price gap&lt;/h2&gt;
&lt;p&gt;The clearest comparison is &lt;a href=&quot;https://docs.github.com/en/billing/reference/actions-runner-pricing&quot;&gt;GitHub hosted runners&lt;/a&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Runner&lt;/th&gt;
&lt;th&gt;Price per minute&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Linux 2-core&lt;/td&gt;
&lt;td&gt;$0.006&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS 3 or 4-core&lt;/td&gt;
&lt;td&gt;$0.062&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS 5-core M2 Pro&lt;/td&gt;
&lt;td&gt;$0.102&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;About 10x for macOS. &lt;a href=&quot;https://namespace.so/pricing&quot;&gt;Namespace&lt;/a&gt; bills macOS at the same 10x multiplier over Linux.&lt;/p&gt;
&lt;h2&gt;Options in the market&lt;/h2&gt;
&lt;p&gt;There are five ways to pay:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Per minute, dev machine.&lt;/strong&gt; A Mac you can SSH into and hand to an agent. The provider eats the 24 hour rule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Per minute, CI only.&lt;/strong&gt; Same idea, but it only runs pipeline jobs. No interactive shell.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flat CI plans.&lt;/strong&gt; A fixed monthly fee for a runner or a bucket of hours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rent a whole Mac.&lt;/strong&gt; By the day or month. You pay the Apple minimum, but it gets cheap once you use it a lot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Colocation.&lt;/strong&gt; You own the Mac, they host it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Entry machine and starting price from each. Sorted cheapest first.&lt;/p&gt;
&lt;h3&gt;Per minute, dev machine&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Machine&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://namespace.so/pricing&quot;&gt;Namespace&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M, 6 vCPU, 14 GB&lt;/td&gt;
&lt;td&gt;$0.06/min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://namespace.so/pricing&quot;&gt;Namespace&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;L, 12 vCPU, 28 GB&lt;/td&gt;
&lt;td&gt;$0.12/min&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Namespace devboxes are the only per minute macOS dev machine I found. Everyone else sells minutes only inside CI.&lt;/p&gt;
&lt;h3&gt;Per minute, CI only&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Entry machine&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://namespace.so/pricing&quot;&gt;Namespace&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;6 vCPU, 14 GB&lt;/td&gt;
&lt;td&gt;$0.06/min&lt;/td&gt;
&lt;td&gt;GitHub Actions runners&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/billing/reference/actions-runner-pricing&quot;&gt;GitHub&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M1, 3 or 4-core&lt;/td&gt;
&lt;td&gt;$0.062/min&lt;/td&gt;
&lt;td&gt;GitHub Actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.warpbuild.com/pricing&quot;&gt;WarpBuild&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4 Pro, 6 vCPU, 14 GB&lt;/td&gt;
&lt;td&gt;$0.08/min&lt;/td&gt;
&lt;td&gt;GitHub Actions runners&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.blacksmith.sh/pricing&quot;&gt;Blacksmith&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4&lt;/td&gt;
&lt;td&gt;$0.08/min&lt;/td&gt;
&lt;td&gt;GitHub Actions runners&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://depot.dev/docs/github-actions/runner-types&quot;&gt;Depot&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M2 or M4, 8 CPU, 24 GB&lt;/td&gt;
&lt;td&gt;$0.08/min&lt;/td&gt;
&lt;td&gt;Capacity can queue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://semaphore.io/pricing&quot;&gt;Semaphore&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;4 vCPU&lt;/td&gt;
&lt;td&gt;$0.09/min&lt;/td&gt;
&lt;td&gt;$15 free credit a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://codemagic.io/pricing&quot;&gt;Codemagic&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M2&lt;/td&gt;
&lt;td&gt;$0.095/min&lt;/td&gt;
&lt;td&gt;500 free min a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://buildkite.com/pricing&quot;&gt;Buildkite&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4, 6 vCPU, 28 GB&lt;/td&gt;
&lt;td&gt;$0.12/min&lt;/td&gt;
&lt;td&gt;Billed per vCPU minute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://circleci.com/pricing/price-list/&quot;&gt;CircleCI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4 Pro, 6 CPU, 28 GB&lt;/td&gt;
&lt;td&gt;≈$0.12/min&lt;/td&gt;
&lt;td&gt;Credits, paid plans only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A 10 minute CI job costs 60 cents to $1.20. Blacksmith&apos;s agent sandboxes are still invite only.&lt;/p&gt;
&lt;h3&gt;Flat CI plans&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;What you get&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://developer.apple.com/xcode-cloud/&quot;&gt;Xcode Cloud&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;25 hours a month&lt;/td&gt;
&lt;td&gt;Free with the Apple Developer Program&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://developer.apple.com/xcode-cloud/&quot;&gt;Xcode Cloud&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;100 hours a month&lt;/td&gt;
&lt;td&gt;$49.99/month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://cirrus-runners.app/pricing/&quot;&gt;Cirrus Runners&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1 runner, M4 Pro, unlimited minutes&lt;/td&gt;
&lt;td&gt;$150/month&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Xcode Cloud only builds Apple platform apps.&lt;/p&gt;
&lt;h3&gt;Rent a whole Mac&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Entry machine&lt;/th&gt;
&lt;th&gt;One day&lt;/th&gt;
&lt;th&gt;Monthly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.scaleway.com/en/pricing/apple-silicon/&quot;&gt;Scaleway&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4, 16 GB&lt;/td&gt;
&lt;td&gt;€5.28 (€0.22/hour)&lt;/td&gt;
&lt;td&gt;€149&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://flow.swiss&quot;&gt;Flow Swiss&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M1, 16 GB&lt;/td&gt;
&lt;td&gt;CHF 6.48 (CHF 0.27/hour)&lt;/td&gt;
&lt;td&gt;CHF 199&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://macly.io/pricing&quot;&gt;Macly&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4, 16 GB&lt;/td&gt;
&lt;td&gt;$14.99&lt;/td&gt;
&lt;td&gt;≈$100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://aws.amazon.com/ec2/instance-types/mac/&quot;&gt;AWS EC2 Mac&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M4, 24 GB&lt;/td&gt;
&lt;td&gt;≈$30 (≈$1.23/hour)&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.oakhost.com/mac-mini-hosting&quot;&gt;OakHost&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M1, 8 GB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;€70 + VAT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.macincloud.com/pages/dedicated.html&quot;&gt;MacinCloud&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M1, 8 GB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;$89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://macstadium.com/pricing&quot;&gt;MacStadium&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;M2, 8 GB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;$109&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Hourly providers bill the first 24 hours no matter what, then by the hour. For an M4 with 16 GB a month runs €115 + VAT at OakHost, $149 at MacStadium and $164 at MacinCloud. Stock is tight: OakHost showed most plans sold out.&lt;/p&gt;
&lt;h3&gt;Colocation&lt;/h3&gt;
&lt;p&gt;Buy your own Mac mini and ship it to a hosting center. They rack it with their other Mac minis, and you stop worrying about electricity and internet.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.hahosting.com/mac-mini-colocation&quot;&gt;HA Hosting&lt;/a&gt; (UK)&lt;/td&gt;
&lt;td&gt;£45 + VAT/month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.macminivault.com/mac-mini-colocation/&quot;&gt;Mac Mini Vault&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;$59.99/month&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Gone or not on offer&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://buildjet.com&quot;&gt;BuildJet&lt;/a&gt; shut down in March 2026. &lt;a href=&quot;https://runs-on.com&quot;&gt;RunsOn&lt;/a&gt; and &lt;a href=&quot;https://www.ubicloud.com&quot;&gt;Ubicloud&lt;/a&gt; are Linux only, and Hetzner dropped its Mac minis.&lt;/p&gt;
&lt;h3&gt;Break even&lt;/h3&gt;
&lt;p&gt;Take Namespace at $0.06/min against Scaleway at €5.28 for a day. Around 90 minutes of macOS in a day, they cost about the same. Use it more than that and the rented Mac wins.&lt;/p&gt;
&lt;p&gt;The same math holds over a month. $100 to $150 a month buys roughly 1,700 to 2,500 Namespace minutes, about an hour a day. If you need macOS longer than that every day, a monthly Mac is cheaper. If you own a Mac mini already, colocation at $60 a month beats both.&lt;/p&gt;
&lt;h3&gt;A Mac at home&lt;/h3&gt;
&lt;p&gt;The cheapest option is still an old Mac mini on your desk, always on. It draws little power. I run one as an &lt;a href=&quot;https://ampcode.com&quot;&gt;Amp&lt;/a&gt; runner. Agents work in Linux VMs by default and call the Mac only when the output needs macOS to verify.&lt;/p&gt;
&lt;h2&gt;Takeaway&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Linux for the bulk of the work, it is 10x cheaper.&lt;/li&gt;
&lt;li&gt;macOS by the minute (Namespace, GitHub, WarpBuild, Depot) for short, bursty jobs.&lt;/li&gt;
&lt;li&gt;Xcode Cloud&apos;s free 25 hours if you only ship Apple apps.&lt;/li&gt;
&lt;li&gt;A rented Mac by the day or month (Scaleway, Macly, MacStadium) once you use it more than an hour a day.&lt;/li&gt;
&lt;li&gt;Your own Mac mini, at home or colocated, if you want it always on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Prices are from provider pages in September 2026 and change often. Check before you commit.&lt;/p&gt;
</content:encoded></item><item><title>The macOS sandbox I actually want</title><link>https://rizwan.dev/blog/2026-11-08_the-macos-sandbox-i-actually-want/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-08_the-macos-sandbox-i-actually-want/</guid><description>Linux VMs start in seconds and stay cheap. A macOS sandbox left on all month still costs about as much as buying a Mac mini, and my M1 Pro is out of room.</description><pubDate>Sun, 08 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I tweeted this yesterday and it got longer than a tweet.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://x.com/rizzu26/status/2119150393653653825&quot;&gt;https://x.com/rizzu26/status/2119150393653653825&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On Linux I spin up a VM, let the agent work inside it, and delete it when done. Nobody thinks about it anymore.&lt;/p&gt;
&lt;p&gt;macOS is not there. I wrote about the license limits and prices in &lt;a href=&quot;/blog/2026-09-28_macos-vm-field-report/&quot;&gt;September&lt;/a&gt;: two VMs per Mac, and a 24 hour minimum when someone else hosts the Mac. Six weeks later both rules are still in Apple&apos;s license. The difference now is that I need one.&lt;/p&gt;
&lt;h2&gt;Who is building it&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://ampcode.com&quot;&gt;Amp&lt;/a&gt;&lt;/strong&gt;: &lt;a href=&quot;https://ampcode.com/docs/orbs/mac&quot;&gt;macOS Satellites&lt;/a&gt;. The thread stays on a Linux orb. When a task needs macOS, Amp starts a Mac with Xcode and the iOS simulators in about 30 seconds and copies changed files over before each command. The Mac app can also &lt;a href=&quot;https://ampcode.com/docs/macos-and-ios/runner&quot;&gt;run threads on this Mac&lt;/a&gt;, which is close to what I do today with a mini at home.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.blacksmith.sh/sandboxes&quot;&gt;Blacksmith&lt;/a&gt;&lt;/strong&gt;: agent sandboxes in beta, full VMs that match their CI environment. Still a waitlist, same as in September.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.daytona.com/docs/macos-sandboxes&quot;&gt;Daytona&lt;/a&gt;&lt;/strong&gt;: macOS sandboxes, and where use.computer went (the old links redirect there). Reserve an M4 Pro Mac for 24 hours and run up to two sandboxes on it. Xcode and the simulator come in the image, and the agent drives apps through screenshots, mouse and keyboard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://tuist.dev/blog/2026/11/04/runners&quot;&gt;Tuist&lt;/a&gt;&lt;/strong&gt;: runners went public this week. Fresh macOS VMs, Xcode compilation cache, and an MCP server so the agent can read job logs. CI today, but the closest thing to a sandbox from someone who only cares about Xcode.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What I want&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Restore, not boot. Come back from a saved state in under a second instead of a cold boot every time.&lt;/li&gt;
&lt;li&gt;One Mac per task, thrown away after. Each agent gets a clean VM, and nothing leaks into the next one.&lt;/li&gt;
&lt;li&gt;Builds that start warm. Xcode is already there, and the image has built the project once, so the first build is not a cold one.&lt;/li&gt;
&lt;li&gt;The agent runs inside the Mac, next to the simulator. Not &lt;code&gt;xcodebuild&lt;/code&gt; over SSH from a Linux box.&lt;/li&gt;
&lt;li&gt;Agents talk to it over MCP. Lease a Mac, run a command, copy files, release. Claude Code or Amp picks it up without me writing glue.&lt;/li&gt;
&lt;li&gt;It runs on Macs I already own. Point it at a mini at home and pay nothing per hour, instead of renting by the day.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And the wishlist on top: pause a VM with Xcode open and resume it later, or fork a warm one when I want to try a second branch.&lt;/p&gt;
&lt;p&gt;Nobody has all of this yet.&lt;/p&gt;
&lt;h2&gt;The bill if you leave it on&lt;/h2&gt;
&lt;p&gt;Daytona charges $60.08 for a 24 hour Mac. Leave it on for a month:&lt;/p&gt;
&lt;p&gt;$60.08 × 30 = $1,802&lt;/p&gt;
&lt;p&gt;That Mac runs two sandboxes, so about $900 each. A new M6 Mac mini starts at $899.&lt;/p&gt;
&lt;p&gt;Renting a bare metal mini is around $100 a month, sometimes more. After nine months you have paid for one.&lt;/p&gt;
&lt;p&gt;&amp;lt;MacBillCalculator /&amp;gt;&lt;/p&gt;
&lt;p&gt;A hosted Mac is easier to swap when a new chip comes out, and a dead disk is not my problem. A mini at home is cheaper to leave running, but the upgrades are on me.&lt;/p&gt;
&lt;h2&gt;Why I care now&lt;/h2&gt;
&lt;p&gt;My laptop is a 2021 M1 Pro with 32 GB and 1 TB. As I write this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;80 GB free, the disk is 92% full&lt;/li&gt;
&lt;li&gt;12 simulators taking 19 GB&lt;/li&gt;
&lt;li&gt;1.9 GB of swap in use&lt;/li&gt;
&lt;li&gt;DerivedData at 0 bytes, because I cleared it again&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Claude Code and Amp run on it all day. Every feature gets a worktree and its own simulator. RAM runs out first, then disk. I clean storage almost every week and still cannot keep a few feature simulators running at the same time.&lt;/p&gt;
&lt;p&gt;I do not want another mini on my desk, and I do not want a cloud bill the size of a new Mac. So for now I will keep the setup from September: rent a cloud Mac for short jobs, and use the mini at home for everything else. Next I want to try Amp Satellites on a real feature and see if it takes that load off this laptop.&lt;/p&gt;
</content:encoded></item><item><title>Blacksmith Testbox for iOS development</title><link>https://rizwan.dev/blog/2026-11-14_blacksmith-testbox-for-ios/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-14_blacksmith-testbox-for-ios/</guid><description>How I let a coding agent build, run, and screenshot an iOS app on a cloud Mac with Blacksmith Testbox, and what it cost.</description><pubDate>Sat, 14 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Last week I wrote about &lt;a href=&quot;/blog/2026-11-08_the-macos-sandbox-i-actually-want/&quot;&gt;the macOS sandbox I actually want&lt;/a&gt;. A few days before that, I had already tried something close to it: &lt;strong&gt;Blacksmith Testbox&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;My problem is simple. Coding agents are great at writing code, but for iOS they need a Mac to build, run tests, and open the simulator. My M1 Pro is out of room, and cloud agents run on Linux. So the agent writes code but can&apos;t check it.&lt;/p&gt;
&lt;h2&gt;What Testbox is&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.blacksmith.sh/blacksmith-testbox/overview&quot;&gt;Testbox&lt;/a&gt; is in early beta. It takes a GitHub Actions job, boots it on a Blacksmith runner (Linux or Apple Silicon macOS), and keeps it alive. Your local changes sync to it, and you run commands on it. Output streams back to your terminal.&lt;/p&gt;
&lt;p&gt;Because it is a real Actions job, it already has your secrets, your setup steps, and your dependencies. The CLI is built for agents, not humans, so the commands and flags are explicit.&lt;/p&gt;
&lt;p&gt;It is two commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# install once
curl -fsSL https://get.blacksmith.sh | sh

# generate a testbox workflow and an agent skill for the repo
blacksmith testbox init

# boot a box, returns an id right away
blacksmith testbox warmup ci-testbox.yml

# sync changed files and run a command
blacksmith testbox run --id &amp;lt;id&amp;gt; &quot;scripts/build.sh&quot;

# done
blacksmith testbox stop --id &amp;lt;id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is what happens between my laptop and the Mac at each step. Click through or press play.&lt;/p&gt;
&lt;p&gt;&amp;lt;TestboxFlow /&amp;gt;&lt;/p&gt;
&lt;p&gt;The sync uses &lt;code&gt;rsync&lt;/code&gt; over SSH, so only changed files go across. After the first run, each &lt;code&gt;run&lt;/code&gt; takes a second or two to start.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;init&lt;/code&gt; also writes a skill file for the agent. It tells the agent to warm up a box as soon as it starts a task, never run tests locally, reuse the same box, and stop it at the end.&lt;/p&gt;
&lt;h2&gt;What I tried&lt;/h2&gt;
&lt;p&gt;I tested it with Claude Code on an iOS app. My ask was small: build the app with Xcode 27.1, launch it in the simulator, and take a screenshot.&lt;/p&gt;
&lt;p&gt;The first warmup failed. &lt;code&gt;blacksmith-6vcpu-macos-latest&lt;/code&gt; was still macOS 26, with no Xcode 27.1. Claude read the failed run log, found that the &lt;code&gt;macos-27&lt;/code&gt; runner has it, switched the label, and pinned the simulator to iOS 27.0 since that was the only runtime on that image. The second box built the app and sent back a screenshot.&lt;/p&gt;
&lt;p&gt;Then I pushed it further. I wanted screenshots of every screen I could reach, to see how the app looks with Liquid Glass on iOS 27.&lt;/p&gt;
&lt;p&gt;Testbox only had &lt;code&gt;node&lt;/code&gt;, so Claude installed &lt;code&gt;agent-device&lt;/code&gt; on the box and used it to drive the simulator: open each screen from the menu, switch the language to Arabic for RTL, and take a screenshot of each screen. Then it downloaded the images and built a gallery page.&lt;/p&gt;
&lt;p&gt;19 screens in about 10 minutes. I didn&apos;t touch the simulator once.&lt;/p&gt;
&lt;p&gt;It wasn&apos;t perfect. One screen hid its rows from the accessibility tree, so the agent tapped by coordinates. Once it tapped blind and switched the app to Dutch. It noticed from the screenshot and fixed it.&lt;/p&gt;
&lt;h2&gt;What it cost&lt;/h2&gt;
&lt;p&gt;The 6 vCPU macOS runner is &lt;strong&gt;$0.08 per minute&lt;/strong&gt;, billed the same as normal Blacksmith CI.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The box I used&lt;/td&gt;
&lt;td&gt;~18 min&lt;/td&gt;
&lt;td&gt;~$1.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failed first warmup&lt;/td&gt;
&lt;td&gt;~1 min&lt;/td&gt;
&lt;td&gt;~$0.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boxes started by workflow PR triggers&lt;/td&gt;
&lt;td&gt;~2 min&lt;/td&gt;
&lt;td&gt;~$0.16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;21 min&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~$1.68&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The catch is idle time. A box keeps billing until you stop it or it times out, and the default idle timeout is 30 minutes. A forgotten macOS box costs about $2.40 that way. So I changed my testbox workflow to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;drop the default idle timeout to 5 minutes,&lt;/li&gt;
&lt;li&gt;install &lt;code&gt;agent-device&lt;/code&gt; during warmup, so the box is ready to drive the app,&lt;/li&gt;
&lt;li&gt;remove the &lt;code&gt;pull_request&lt;/code&gt; trigger that &lt;code&gt;init&lt;/code&gt; added, which started boxes nobody used.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why I like it&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The agent gets a real Mac only when it needs one, and I pay by the minute.&lt;/li&gt;
&lt;li&gt;It reuses my CI setup, so there&apos;s no separate machine to maintain.&lt;/li&gt;
&lt;li&gt;Each agent can get its own box, so parallel worktrees don&apos;t fight over one simulator.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;blacksmith&lt;/code&gt; CLI is just a client. It runs on Linux too, so a Claude Code cloud session can write code on Linux and build and test on the Mac.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What you give up: no Xcode previews or debugger, and a couple of minutes of warmup on a fresh box. Out of the box you only get screenshots and recordings of the simulator, but you can install &lt;code&gt;simserv&lt;/code&gt; on the box and watch the simulator live.&lt;/p&gt;
&lt;p&gt;If you already use Blacksmith for CI, give Testbox a try.&lt;/p&gt;
</content:encoded></item><item><title>Cryo: frozen Macs, thawed in seconds</title><link>https://rizwan.dev/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/</guid><description>I built the macOS sandbox I wanted. Clean, isolated macOS VMs on Macs you already own, ready over SSH in well under a second, for coding agents and CI. It is open source.</description><pubDate>Tue, 17 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/cryo-hero-light.svg&quot;
alt=&quot;cryo. Frozen Macs, thawed in seconds. Two Mac minis on a bay: one frozen, one thawed and leased.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/cryo-hero-dark.svg&quot;
alt=&quot;cryo. Frozen Macs, thawed in seconds. Two Mac minis on a bay: one frozen, one thawed and leased.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;A week ago I wrote about &lt;a href=&quot;/blog/2026-11-08_the-macos-sandbox-i-actually-want/&quot;&gt;the macOS sandbox I actually want&lt;/a&gt; and ended with &quot;Nobody has all of this yet.&quot;&lt;/p&gt;
&lt;p&gt;So I built it. It is called &lt;strong&gt;&lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;Cryo&lt;/a&gt;&lt;/strong&gt;, and it is open source.&lt;/p&gt;
&lt;p&gt;&amp;lt;video
src=&quot;/videos/cryo/cryo-launch.mp4&quot;
controls
playsinline
preload=&quot;metadata&quot;
aria-label=&quot;Cryo launch video: a clean macOS VM leased in about 150 milliseconds, used by an agent and by cryo-ci, then thrown away.&quot;
class=&quot;w-full rounded-lg&quot;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;cryo lease            # L81 ready: ssh cryo-L81
ssh cryo-L81 &apos;xcodebuild test ...&apos;
cryo release L81      # gone; a clean one is already thawing
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What it is&lt;/h2&gt;
&lt;p&gt;Cryo turns the Macs you already own into a pool of clean, isolated macOS VMs. Each VM waits on disk as saved machine state, frozen. When an agent asks for a Mac, Cryo thaws one and hands it over. When the agent is done, the VM is thrown away and a fresh one is thawed in its place.&lt;/p&gt;
&lt;p&gt;The words come from cryo-sleep in sci-fi: crews frozen in stasis and woken up when needed. A &lt;strong&gt;bay&lt;/strong&gt; is one Mac. A &lt;strong&gt;capsule&lt;/strong&gt; is one VM on it. Apple&apos;s license allows two macOS VMs per Mac, so each bay has two capsules.&lt;/p&gt;
&lt;h2&gt;The wishlist, checked&lt;/h2&gt;
&lt;p&gt;Here is the list from last week, and where Cryo is today:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Restore, not boot.&lt;/strong&gt; A capsule waits as saved state and is restored ahead of time. Getting a lease is a resume plus an SSH login, well under a second on my M1 Pro. A cold boot takes many seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One Mac per task, thrown away after.&lt;/strong&gt; Every lease gets its own copy-on-write disk, a fresh SSH key and its own network. Release deletes all of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds that start warm.&lt;/strong&gt; &lt;code&gt;cryo image build --xcode&lt;/code&gt; puts Xcode and the simulator runtimes into a golden image. Freezing runs a warm-up build first, so the first build in a lease is not a cold one. Per-project cache disks keep DerivedData and packages between leases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agents talk to it over MCP.&lt;/strong&gt; &lt;code&gt;cryo mcp&lt;/code&gt; has &lt;code&gt;lease_mac&lt;/code&gt;, &lt;code&gt;run&lt;/code&gt;, &lt;code&gt;copy_in&lt;/code&gt;, &lt;code&gt;copy_out&lt;/code&gt; and &lt;code&gt;release_mac&lt;/code&gt;. There is also an agent skill. Claude Code, Amp or any MCP client picks it up with one line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It runs on Macs I already own.&lt;/strong&gt; A mini at home, a laptop, a shelf of minis. No account and no per-minute bill.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pausing a VM with Xcode open and forking a warm one are still on the wishlist.&lt;/p&gt;
&lt;h2&gt;Isolated by default&lt;/h2&gt;
&lt;p&gt;Each capsule gets its own network. A firewall keeps it away from the host, the LAN and the other capsule; it only reaches DNS and the internet. Agents never see a capsule&apos;s IP. They go through &lt;code&gt;cryo ssh&lt;/code&gt;, with a key that only works for that lease.&lt;/p&gt;
&lt;p&gt;That is the part I care about most. My laptop has my keychain and my SSH keys. An agent that runs commands on its own should not be anywhere near them.&lt;/p&gt;
&lt;h2&gt;CI on the same Macs&lt;/h2&gt;
&lt;p&gt;The same capsules run GitHub Actions jobs. &lt;strong&gt;&lt;a href=&quot;https://github.com/rizwankce/cryo-ci&quot;&gt;cryo-ci&lt;/a&gt;&lt;/strong&gt; watches your repos for jobs that ask for a &lt;code&gt;cryo&lt;/code&gt; label, leases a capsule for each one, starts a one-job runner in it, and releases the capsule when the job ends.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jobs:
  test:
    runs-on: cryo-xcode-27.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Agents and CI share the bay and its queue. The mini is busy all day instead of waiting for the next job.&lt;/p&gt;
&lt;h2&gt;What inspired it&lt;/h2&gt;
&lt;p&gt;Two products shaped Cryo.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://ampcode.com/docs/orbs/mac&quot;&gt;Amp&apos;s macOS Satellites&lt;/a&gt;.&lt;/strong&gt; The thread stays on Linux, and Amp starts a Mac only when the task needs one. That is the right split. Most of an agent&apos;s work does not need macOS, but when it does, it needs a real Mac with Xcode and the simulator, not a guess.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://tuist.dev/blog/2026/11/04/runners&quot;&gt;Tuist Runners&lt;/a&gt;.&lt;/strong&gt; A fresh VM for every job, cache volumes per repo, and an MCP server so the agent can read the logs. Tuist went down to the bare metal and racked their own Mac minis.&lt;/p&gt;
&lt;h2&gt;Why open source&lt;/h2&gt;
&lt;p&gt;The Tuist post has a paragraph that stuck with me:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the knowledge to build something like this is available to anyone, keeping our implementation closed isn&apos;t where the value lies. The value we provide is in packaging it all together, operating it, and offering a service that&apos;s ready to use.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And a little earlier in the same post:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A few years ago, a team our size probably couldn&apos;t have taken it on, but today, so much of that knowledge is available through AI models.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is how Cryo was built: one person, a lot of reading of Apple&apos;s Virtualization docs, and coding agents doing much of the typing. Anyone with the same idea can build the same thing now. Keeping the code closed would not protect much. Putting it out means people can read it, run it on their own Macs, and tell me where it breaks.&lt;/p&gt;
&lt;p&gt;There is also the license. Apple allows two macOS VMs on a Mac you own or control, for your own use. Software that runs on your own Macs is the use the license is written for.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS 27 only.&lt;/strong&gt; It uses Virtualization APIs that are new in macOS 27. macOS 26 and earlier are not supported.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two capsules per Mac.&lt;/strong&gt; That is Apple&apos;s limit, not mine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Mac stays logged in and unlocked.&lt;/strong&gt; The bay runs as a LaunchAgent in your session.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IPv6 is not fenced yet.&lt;/strong&gt; The firewall is IPv4 only for now; it is &lt;a href=&quot;https://github.com/rizwankce/cryo/issues/1&quot;&gt;the first open issue&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Try it&lt;/h2&gt;
&lt;p&gt;You need an Apple silicon Mac on macOS 27 with about 150 GB free.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo
cryo bay install            # LaunchAgent and firewall, one sudo prompt
cryo image build --xcode    # a golden image with Xcode
cryo image use &amp;lt;digest&amp;gt;     # freeze both capsules from it
cryo lease
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For agents: &lt;code&gt;claude mcp add cryo -- cryo mcp&lt;/code&gt;. For CI: &lt;code&gt;brew install rizwankce/tap/cryo-ci&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;. If you try it, I would love to hear what breaks.&lt;/p&gt;
</content:encoded></item><item><title>Restore, not boot: a clean Mac in under 200 ms</title><link>https://rizwan.dev/blog/2026-11-20_restore-not-boot/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-20_restore-not-boot/</guid><description>How Cryo hands out a clean macOS VM over SSH in 135–198 ms. Saved machine state instead of a cold boot, VMs thawed ahead of time, and a few traps on the way.</description><pubDate>Fri, 20 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/restore-not-boot-light.svg&quot;
alt=&quot;cryo. Restore, not boot. Three states of a Cryo capsule: frozen on disk, paused in RAM, resumed and leased in about 150 ms.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/restore-not-boot-dark.svg&quot;
alt=&quot;cryo. Restore, not boot. Three states of a Cryo capsule: frozen on disk, paused in RAM, resumed and leased in about 150 ms.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;When I &lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;launched Cryo&lt;/a&gt;, the first item on the list was &quot;restore, not boot.&quot; This post is about that one line: how a lease goes from many seconds to about 150 ms, and what I measured on the way.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo lease            # L81 ready: ssh cryo-L81
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That command returns in &lt;strong&gt;135–198 ms&lt;/strong&gt; on my M1 Pro, with Xcode in the image. The VM behind it is clean, has its own SSH key and has never been used.&lt;/p&gt;
&lt;h2&gt;Cold boot is the slow way&lt;/h2&gt;
&lt;p&gt;A macOS VM that boots from scratch takes about &lt;strong&gt;9–10 s&lt;/strong&gt; before SSH answers. That is fine once a day. It is too slow for an agent that wants a fresh Mac for every task, or for CI that runs dozens of jobs.&lt;/p&gt;
&lt;p&gt;Apple&apos;s Virtualization framework can save a running VM&apos;s full machine state to a file and restore it later. CPU, memory, devices, everything. Restoring is like waking a laptop from sleep instead of turning it on.&lt;/p&gt;
&lt;p&gt;Here is what each approach costs, measured on one MacBook Pro M1 Pro running macOS 27.2:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cold boot → SSH                   ~9–10 s
restore from disk → SSH           ~2.6 s (4 GB VM)  ~4.2 s (8 GB, Xcode)
resume a restored VM → SSH        ~0.65–0.8 s
resume a VM paused after rekey    135–198 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each step moves more work ahead of the lease.&lt;/p&gt;
&lt;h2&gt;Restore speed is memory size&lt;/h2&gt;
&lt;p&gt;Restoring reads the saved state file, which is about the size of the memory the guest was using. Restore throughput topped out around &lt;strong&gt;750 MB/s&lt;/strong&gt;, well below raw SSD speed — the state file is encrypted to the host, so decryption is likely the bottleneck.&lt;/p&gt;
&lt;p&gt;So less memory means a faster restore. An 8 GB VM saved about 3 GB of state; a 4 GB one about 1.4 GB. That&apos;s the difference between ~4.2 s and ~2.6 s.&lt;/p&gt;
&lt;h2&gt;Thaw ahead of time&lt;/h2&gt;
&lt;p&gt;The real trick is not restoring while someone waits. Cryo restores each VM ahead of time and leaves it &lt;strong&gt;paused&lt;/strong&gt; in memory. I call that a thawed capsule. A lease is then just &quot;resume, then log in once.&quot;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; frozen on disk ──restore──▶ paused in RAM ──lease──▶ resumed, yours
                 (seconds)                  (ms)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is a limit. macOS 27.2 allows two VMs per Mac, and paused VMs count. A third restore fails with &quot;maximum supported number of active virtual machines.&quot; So each Mac holds two warm capsules, no more.&lt;/p&gt;
&lt;h2&gt;Where the last second went&lt;/h2&gt;
&lt;p&gt;The first version of a pre-thawed lease took about &lt;strong&gt;1.5 s&lt;/strong&gt;. Almost none of that was the VM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The first SSH login after a resume was cold.&lt;/strong&gt; sshd, PAM and directory services all paged in their code on that first login. Logging in three times just before saving the state puts those pages into the snapshot. Lease time dropped from 1501 to 705 ms.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clearing memory before saving made it worse.&lt;/strong&gt; It evicted exactly the pages those warm-up logins brought in, and barely shrank the file. Taking it out gave another ~60 ms.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;My own SSH config was slow.&lt;/strong&gt; A password-manager agent and a couple of &lt;code&gt;Include&lt;/code&gt; lines added ~165 ms to every connection. Cryo now writes its own SSH config for each lease and ignores yours.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That got a lease to about &lt;strong&gt;0.65 s&lt;/strong&gt;. What was left was mostly the resume itself: about 0.6 s, regardless of RAM or CPU count.&lt;/p&gt;
&lt;h2&gt;Resume a VM that was running&lt;/h2&gt;
&lt;p&gt;The last speedup happened by accident. Every lease needs its own SSH host key and hostname, so I had to change both after restore. I first did that during the lease, which cost time.&lt;/p&gt;
&lt;p&gt;Then I moved it to the refill. After a release, the bay restores the capsule, resumes it, gives it a new host key and hostname, logs in three times, and pauses it again. It never saves that state back to disk.&lt;/p&gt;
&lt;p&gt;Resuming a VM that was paused while running costs &lt;strong&gt;1–25 ms&lt;/strong&gt;. Resuming one that was just restored costs ~0.6 s. So a lease from that state is a resume plus one login that also sets the guest clock. On the bay that runs my iOS CI today, that is &lt;strong&gt;135–198 ms&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;release ─▶ restore ─▶ resume ─▶ new host key + hostname ─▶ 3 warm-up logins ─▶ pause
           └──────────────────── refill: 7.5–11.4 s, off the lease path ─────────────┘

lease   ─▶ resume ─▶ set clock over SSH ─▶ ready        135–198 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Traps I hit&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A locked screen breaks restore.&lt;/strong&gt; The saved state is protected by the keychain. Restores fail with &quot;permission denied&quot; once the screen locks. VMs already paused in memory keep working. So a Cryo Mac stays logged in and unlocked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One identity can&apos;t run twice.&lt;/strong&gt; Restoring a second VM from the same state fails, even from a copy of the file. Each capsule is frozen on its own, with its own machine ID and MAC address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saved state is tied to the Mac.&lt;/strong&gt; It can&apos;t move to another machine. Each Mac freezes its own capsules from a shared golden image.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some freezes come back with a stalled network.&lt;/strong&gt; About 2.7 s of dropped packets after resume, on some snapshots and not others. I have not found the cause. Cryo now tests every freeze once and refreezes if the first SSH takes more than a second.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never freeze with the Simulator running.&lt;/strong&gt; Its services all relaunch after a restore and the VM grinds for a while.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Refill takes 7.5–11.4 s.&lt;/strong&gt; With two capsules busy, the next lease waits for a release plus a refill.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two warm capsules per Mac.&lt;/strong&gt; That is Apple&apos;s limit. Extra warmth can only live on disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Mac must stay unlocked&lt;/strong&gt; for refills to work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The full design is in the &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/capsule.md&quot;&gt;capsule spec&lt;/a&gt;. The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>What happens in a Cryo lease</title><link>https://rizwan.dev/blog/2026-11-21_what-happens-in-a-cryo-lease/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-21_what-happens-in-a-cryo-lease/</guid><description>A walk through one Cryo lease, from `cryo lease` to `cryo release`. Its own disk, SSH keys and network, a folder and a cache disk, and how all of it is thrown away.</description><pubDate>Sat, 21 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/what-happens-in-a-cryo-lease-light.svg&quot;
alt=&quot;cryo. What happens in a lease. One leased Mac mini with its own disk overlay, SSH key, network and cache disk, all thrown away on release.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/what-happens-in-a-cryo-lease-dark.svg&quot;
alt=&quot;cryo. What happens in a lease. One leased Mac mini with its own disk overlay, SSH key, network and cache disk, all thrown away on release.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;In the &lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo launch post&lt;/a&gt; I wrote &quot;one Mac per task, thrown away after.&quot; This post walks through a single lease from start to finish.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo lease --folder ./MyApp --cache myapp    # L82 ready: ssh cryo-L82
ssh cryo-L82 &apos;cd &quot;/Volumes/My Shared Files&quot; &amp;amp;&amp;amp; swift test&apos;
cryo release L82 --save-cache
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Before you ask&lt;/h2&gt;
&lt;p&gt;A capsule is one VM slot on a Mac. Before anyone asks for it, the bay has already done most of the work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It restored the capsule from its saved state and resumed it.&lt;/li&gt;
&lt;li&gt;It gave it a &lt;strong&gt;new SSH host key&lt;/strong&gt; and pre-assigned the next lease ID as its hostname (&lt;code&gt;cryo-L82&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It installed a &lt;strong&gt;fresh login key&lt;/strong&gt; that only that lease will get.&lt;/li&gt;
&lt;li&gt;It logged in three times to warm SSH up, then paused it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the time you ask for a lease, the ID, hostname, and keys are already in place.&lt;/p&gt;
&lt;h2&gt;The disk: three layers&lt;/h2&gt;
&lt;p&gt;Every capsule runs on a stack of disks:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; golden image (read-only, shared by both capsules)
   └─ freeze layer (this capsule&apos;s saved state, per capsule)
        └─ lease overlay (new for every lease, copy-on-write)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The lease overlay is a new, empty copy-on-write disk image. It costs about &lt;strong&gt;0 bytes and ~20 ms&lt;/strong&gt; to create. Everything the lease writes goes there. Nothing reaches the layers below.&lt;/p&gt;
&lt;h2&gt;Keys and SSH&lt;/h2&gt;
&lt;p&gt;On your side, &lt;code&gt;cryo lease&lt;/code&gt; writes the lease&apos;s private key and its pinned host key into &lt;code&gt;~/.cryo&lt;/code&gt;, plus a &lt;code&gt;Host cryo-L82&lt;/code&gt; block in Cryo&apos;s own SSH config that proxies through the bay via &lt;code&gt;ProxyCommand cryo ssh L82&lt;/code&gt;. &lt;code&gt;ssh cryo-L82&lt;/code&gt; then just works.&lt;/p&gt;
&lt;p&gt;The key only opens that one lease. The host key is new, so an old lease&apos;s &lt;code&gt;known_hosts&lt;/code&gt; entry never matches a new one. Cryo&apos;s SSH config also skips your agent and your &lt;code&gt;~/.ssh/config&lt;/code&gt;, which saved ~165 ms per connection on my Mac.&lt;/p&gt;
&lt;h2&gt;The network&lt;/h2&gt;
&lt;p&gt;Each capsule has its own virtual network: capsule 0 on &lt;code&gt;10.77.0.0/24&lt;/code&gt;, capsule 1 on &lt;code&gt;10.77.1.0/24&lt;/code&gt;. A firewall keeps it off the host, the LAN and the other capsule. It reaches DNS and the internet, nothing else.&lt;/p&gt;
&lt;p&gt;Neither you nor your agents ever see the VM&apos;s IP — &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;scp&lt;/code&gt;, and &lt;code&gt;rsync&lt;/code&gt; all tunnel through &lt;code&gt;cryo ssh&lt;/code&gt; via the bay.&lt;/p&gt;
&lt;h2&gt;The folder&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;--folder&lt;/code&gt; puts a folder from your Mac into the lease. The bay makes an APFS clone of it, so your copy is never touched, and swaps it into the VM&apos;s shared folder. The guest sees it at:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/Volumes/My Shared Files
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The swap itself is effectively instant (&amp;lt;1 ms); the guest sees the new folder about 143 ms later. Binaries and scripts in the folder run fine from there.&lt;/p&gt;
&lt;p&gt;Two rules came out of testing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One swap per lease.&lt;/strong&gt; Swapping a second folder in the same VM made some binaries fail with &quot;operation not permitted&quot; on their first run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ship trees as one archive.&lt;/strong&gt; Copying a folder full of symlinks out of the share failed, and once took the guest&apos;s network down with it. A single tarball, unpacked onto the VM disk, took 2 s.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The cache disk&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;--cache myapp&lt;/code&gt; attaches a disk for build caches: DerivedData, packages, anything you want to survive between leases. It is an APFS clone of &lt;code&gt;~/.cryo/caches/myapp.asif&lt;/code&gt;, plugged into the VM as a USB disk, and mounted at &lt;code&gt;/Volumes/Cache&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Mounting a USB disk in the guest takes about 1.3–1.4 s, so a lease with an existing cache takes &lt;strong&gt;1.6–1.8 s&lt;/strong&gt; instead of 135–198 ms. A new cache is a 64 GB sparse image created on the spot, which brings it to ~2.5 s.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cryo release --save-cache&lt;/code&gt; commits what the lease wrote. Without it, the clone is discarded and the cache stays untouched.&lt;/p&gt;
&lt;h2&gt;How long it lives&lt;/h2&gt;
&lt;p&gt;A lease is kept alive by activity: a renew call or an open &lt;code&gt;cryo ssh&lt;/code&gt; session. Idle leases are reclaimed automatically: 5 minutes for MCP agents, 60 minutes by default for the CLI (&lt;code&gt;--idle&lt;/code&gt;), with a 24-hour hard cap. An open SSH session never expires in the middle of work.&lt;/p&gt;
&lt;h2&gt;Release&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;release ─▶ stop the VM ─▶ detach USB ─▶ save cache? ─▶ delete leases/L82/ ─▶ refill
           0.25–0.77 s                                                       7.5–11.4 s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The bay stops the VM from the host. It never asks the guest to shut down, so a stuck guest can&apos;t hold things up. Then it deletes the lease folder, the overlay, the clone and the keys. Nothing from L82 is left.&lt;/p&gt;
&lt;p&gt;Right after, the capsule refills: restore, new keys, new hostname for the next ID, warm-up logins, pause. About 10 s later a clean Mac is waiting again.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No pause or fork.&lt;/strong&gt; You can&apos;t pause a lease with Xcode open and come back later, or fork a warm one into two.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folder is set once.&lt;/strong&gt; It is swapped in before you get the lease and never changed while it runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Back-to-back leases wait for a refill.&lt;/strong&gt; With both capsules busy, the next one waits for a release plus ~10 s.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The full lifecycle is in the &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/capsule.md&quot;&gt;capsule spec&lt;/a&gt; and the &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/cli.md&quot;&gt;CLI spec&lt;/a&gt;. The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Cryo: isolated by default</title><link>https://rizwan.dev/blog/2026-11-22_cryo-isolated-by-default/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-22_cryo-isolated-by-default/</guid><description>How Cryo keeps a coding agent&apos;s macOS VM away from your Mac, your LAN and the other VM. One network per capsule, a pf fence, a fresh SSH key per lease, and IPv6 now fenced too.</description><pubDate>Sun, 22 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/cryo-isolated-by-default-light.svg&quot;
alt=&quot;cryo. Isolated by default. Two leased capsules on their own networks behind a pf fence: each reaches the internet, but not the host, the LAN or the other capsule.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/cryo-isolated-by-default-dark.svg&quot;
alt=&quot;cryo. Isolated by default. Two leased capsules on their own networks behind a pf fence: each reaches the internet, but not the host, the LAN or the other capsule.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;In the &lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo launch post&lt;/a&gt; I said isolation is the part I care about most. Here&apos;s how it works.&lt;/p&gt;
&lt;p&gt;The short version: a capsule can reach DNS and the internet. It cannot reach your Mac, your LAN or the other capsule. The agent never learns its IP address, and the SSH key it gets is useless once the lease ends.&lt;/p&gt;
&lt;h2&gt;Why it matters&lt;/h2&gt;
&lt;p&gt;My laptop has my keychain, my SSH keys, my browser sessions and every service I left listening on &lt;code&gt;*&lt;/code&gt;. A coding agent runs commands on its own. Some of those commands come from READMEs, issues and packages I did not write.&lt;/p&gt;
&lt;p&gt;A VM is a good start, but a VM on a shared network is still a machine on my LAN. It can scan the router, poke at the host, and talk to the VM next to it. So Cryo treats the network as part of the sandbox, not an afterthought.&lt;/p&gt;
&lt;h2&gt;One network per capsule&lt;/h2&gt;
&lt;p&gt;Each capsule gets its own vmnet network, made with Apple&apos;s Virtualization framework:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;capsule 0   10.77.0.0/24   gateway 10.77.0.1   guest 10.77.0.2
capsule 1   10.77.1.0/24   gateway 10.77.1.1   guest 10.77.1.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The guest IP is pinned at &lt;code&gt;.2&lt;/code&gt; when the capsule is frozen, so it is the same on every thaw. There is no port forward. Early on I used vmnet&apos;s port forward for SSH, and it turned out to listen on the LAN IP too, so any machine on my network could reach the guest&apos;s SSH. That forward is gone. The host reaches the guest IP directly.&lt;/p&gt;
&lt;p&gt;Two capsules on two networks cannot see each other at the network layer. That alone is not enough, though. In my first test, a vmnet guest could still reach my router&apos;s web page and the host&apos;s LAN IP.&lt;/p&gt;
&lt;h2&gt;The fence&lt;/h2&gt;
&lt;p&gt;The rest is a pf anchor. &lt;code&gt;cryo bay install&lt;/code&gt; loads it into &lt;code&gt;com.apple/cryo&lt;/code&gt;, which the stock &lt;code&gt;/etc/pf.conf&lt;/code&gt; already evaluates, so Cryo never edits &lt;code&gt;pf.conf&lt;/code&gt;. A root LaunchDaemon loads the rules again at every boot.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;             ┌──────────────┐
             │   internet   │
             └──────▲───────┘
                    │ pass
┌───────────┐  DNS  │
│ capsule 0 ├───────┼──▶ 10.77.0.1:53   pass (its own gateway only)
└─────┬─────┘       │
      │             ├──▶ host LAN IP       blocked
      │             ├──▶ router, LAN       blocked
      │             └──▶ capsule 1         blocked
      ▲
      └── host → guest SSH (the bay only)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What the rules say, in words:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A capsule may send DNS to its own gateway, and nothing else on port 53.&lt;/li&gt;
&lt;li&gt;A capsule may not send anything to a private address range: not the host, not the LAN, not the other capsule.&lt;/li&gt;
&lt;li&gt;Private sources may not reach a capsule, except the bay on the host itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before and after the fence, from inside a capsule: the internet stayed reachable, DNS kept working, and the LAN router went from open to blocked. Leasing was just as fast with the fence on.&lt;/p&gt;
&lt;h2&gt;IPv6, now fenced too&lt;/h2&gt;
&lt;p&gt;The launch post listed one gap: the firewall was IPv4 only. That was &lt;a href=&quot;https://github.com/rizwankce/cryo/issues/1&quot;&gt;issue #1&lt;/a&gt;, and it is fixed in 0.1.3.&lt;/p&gt;
&lt;p&gt;The gap was real. The guest has no global IPv6, so the LAN and the internet were never reachable over v6. But the host&apos;s vmnet bridge has an IPv6 link-local address, and from a lease I could reach host services on it that the IPv4 fence blocked: ControlCenter and the AirPlay receiver on ports 5000 and 7000, and &lt;code&gt;rapportd&lt;/code&gt;. Anything on the host listening on all interfaces was exposed over IPv6.&lt;/p&gt;
&lt;p&gt;Turning off router advertisements would not help, because the bridge&apos;s link-local address does not come from them. The fix is to drop all IPv6 coming in on the vmnet bridges. macOS pf has no &lt;code&gt;bridge&lt;/code&gt; interface group (&lt;code&gt;on bridge&lt;/code&gt; loads fine and matches nothing), so the anchor lists &lt;code&gt;bridge100&lt;/code&gt; to &lt;code&gt;bridge199&lt;/code&gt; by name. After that, from a lease, &lt;code&gt;ping6&lt;/code&gt; and every one of those ports on the bridge&apos;s link-local address were blocked, and the fence check script passes on my Mac.&lt;/p&gt;
&lt;p&gt;The trade-off: other VM tools on the same Mac also lose IPv6 to the host on those bridges. For a Mac that runs Cryo, I think that is the right default.&lt;/p&gt;
&lt;h2&gt;Agents never see the IP&lt;/h2&gt;
&lt;p&gt;An agent does not get &lt;code&gt;10.77.0.2&lt;/code&gt;. It gets a name:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo lease          # L81 ready: ssh cryo-L81
ssh cryo-L81 &apos;uname -a&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cryo-L81&lt;/code&gt; is a Host block in an SSH config that &lt;code&gt;cryo setup&lt;/code&gt; includes. Its ProxyCommand is &lt;code&gt;cryo ssh L81&lt;/code&gt;, which asks the bay to connect and pipes the bytes through. So &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;scp&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; all work, but the agent never holds an address it could use for anything else.&lt;/p&gt;
&lt;h2&gt;A fresh key per lease&lt;/h2&gt;
&lt;p&gt;While a capsule refills, the bay makes a new Ed25519 key pair for the next lease and adds the public key to the guest. The guest also gets a new host key, and the lease hands that host key back to the client. The client writes it to a known_hosts file just for that lease, with strict checking on.&lt;/p&gt;
&lt;p&gt;That means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The key in the agent&apos;s hands works for one lease. After release the capsule is deleted, and the key opens nothing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.ssh/known_hosts&lt;/code&gt; is never touched, and you never see a host key mismatch when a new capsule shows up at the same name.&lt;/li&gt;
&lt;li&gt;Your own SSH keys never go near the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;And then it is thrown away&lt;/h2&gt;
&lt;p&gt;Isolation in space is half of it. The other half is time. Every lease gets its own copy-on-write disk. Release stops the VM from the host and deletes the lease&apos;s folder. Whatever an agent installed, downloaded or broke is gone, and the next lease starts from the same frozen state.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Mac you run it on must be one you trust.&lt;/strong&gt; The fence protects the host from the guest, not the other way around.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The guest can reach the internet.&lt;/strong&gt; There is no allowlist of domains. If you need one, put a proxy in front — Cryo doesn&apos;t do domain filtering today.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pf needs root once.&lt;/strong&gt; &lt;code&gt;cryo bay install&lt;/code&gt; asks for one sudo prompt. The bay itself never runs &lt;code&gt;pfctl&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The rules are in the repo, and the capsule spec has the full network section: &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/capsule.md&quot;&gt;docs/spec/capsule.md&lt;/a&gt;. The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Cryo: builds that start warm</title><link>https://rizwan.dev/blog/2026-11-23_cryo-builds-that-start-warm/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-23_cryo-builds-that-start-warm/</guid><description>Every Cryo lease is a clean macOS VM, which usually means a cold first build. A golden image with Xcode, a warm-up build before the freeze and per-project cache disks get most of that time back.</description><pubDate>Mon, 23 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/cryo-builds-that-start-warm-light.svg&quot;
alt=&quot;cryo. Builds that start warm. A capsule frozen with Xcode gets a warm-up build before the freeze, then thaws with warm caches and a per-project cache disk: 20.8 s instead of 42.8 s.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/cryo-builds-that-start-warm-dark.svg&quot;
alt=&quot;cryo. Builds that start warm. A capsule frozen with Xcode gets a warm-up build before the freeze, then thaws with warm caches and a per-project cache disk: 20.8 s instead of 42.8 s.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;In the &lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo launch post&lt;/a&gt; one line on the wishlist was &quot;builds that start warm&quot;. This post is about that line.&lt;/p&gt;
&lt;p&gt;A clean VM for every lease is the point of Cryo. It is also the problem. Clean means no DerivedData, no module cache and no Simulator that has booted before. The first &lt;code&gt;xcodebuild&lt;/code&gt; in a fresh lease pays for all of that.&lt;/p&gt;
&lt;h2&gt;Where the time goes&lt;/h2&gt;
&lt;p&gt;I measured this with a test project: a Swift package with 60 SwiftUI files and a Swift Testing target, run with &lt;code&gt;xcodebuild test&lt;/code&gt; on an iPhone Simulator, in a capsule with 4 vCPU and 8 GB.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First &lt;code&gt;xcodebuild test&lt;/code&gt; in a fresh lease&lt;/td&gt;
&lt;td&gt;77–105 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Same, run again (warm DerivedData)&lt;/td&gt;
&lt;td&gt;24 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Simulator boot on its own&lt;/td&gt;
&lt;td&gt;19.6 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warm test, Simulator already booted, no parallel clones&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.7 s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two things stand out. The first run is cold. And even when it is warm, most of a test run is the Simulator, not the compiler. Cryo has an answer for each.&lt;/p&gt;
&lt;h2&gt;A golden image with Xcode in it&lt;/h2&gt;
&lt;p&gt;Every capsule is frozen from a golden image. One command builds it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo image build --xcode    # macOS + your Xcode + the iOS Simulator runtime
cryo image use &amp;lt;digest&amp;gt;     # freeze both capsules from it
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;image build&lt;/code&gt; downloads the newest macOS restore image from Apple, installs it on a fresh disk, creates a &lt;code&gt;cryo&lt;/code&gt; user with SSH, and turns off sleep, Spotlight and automatic updates. With &lt;code&gt;--xcode&lt;/code&gt; it copies the Xcode you have selected on the host into the VM, accepts the license, runs first launch and downloads the iOS Simulator runtime. No Apple ID is needed.&lt;/p&gt;
&lt;p&gt;On my M1 Pro the whole build took about 16 minutes and made a 56 GB image. Images are named by a digest of their contents, so &quot;the Xcode 27.2 image&quot; cannot quietly mean two different things on two Macs.&lt;/p&gt;
&lt;p&gt;Bundling Xcode doesn&apos;t slow leases down. The disk is not part of the saved state, so a lease from the Xcode image is as fast as one from a plain image.&lt;/p&gt;
&lt;h2&gt;A warm-up build before the freeze&lt;/h2&gt;
&lt;p&gt;Xcode in the image is not the same as a warm Xcode. A fresh capsule with Xcode still built my 60-file iOS package in 48 s.&lt;/p&gt;
&lt;p&gt;Most of that turned out to be shared work that every project redoes: the SDK&apos;s precompiled modules, the module cache and the compilation cache. They live at the root of DerivedData, not inside a project&apos;s folder. So I tried building a different, much smaller SwiftUI package first, deleted its project folder, and then built the real one. It went from 48 s to 15–21 s.&lt;/p&gt;
&lt;p&gt;That is now part of the freeze. &lt;code&gt;cryo image use&lt;/code&gt; runs a warm-up build for the iOS Simulator before it freezes a capsule:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;image ──▶ boot capsule ──▶ warm-up build ──▶ freeze
                           (~45–51 s, once)     │
                                               ▼
                          every lease thaws with the shared caches already warm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On the real bay, the same iOS build in a lease took 20.8 s on a warmed capsule and 42.8 s on a cold one. The warm-up costs under a minute per freeze and saves around 20 s on every lease after it.&lt;/p&gt;
&lt;p&gt;It does not boot a Simulator. A capsule frozen with a booted Simulator restores fine and then falls over within a minute, with hundreds of processes and repeated crash reports. So the rule is simple: never freeze with a Simulator running.&lt;/p&gt;
&lt;h2&gt;Per-project cache disks&lt;/h2&gt;
&lt;p&gt;The warm-up covers what every project shares. Your project&apos;s own packages and build products are a different story. For those there are cache disks:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo lease --cache myapp          # /Volumes/Cache in the guest
cryo release L81 --save-cache     # keep what this lease wrote
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A cache disk is an APFS disk image on the host, &lt;code&gt;caches/myapp.asif&lt;/code&gt;. Each lease gets a copy-on-write clone of it, attached as a USB disk. By default it&apos;s ephemeral: whatever the lease writes is discarded with the clone. Release with &lt;code&gt;--save-cache&lt;/code&gt; and the lease&apos;s copy replaces the cache, so the next lease starts from it. Run that from your trusted builds, like main, and every lease gets the packages and caches main had.&lt;/p&gt;
&lt;p&gt;Why a USB disk and not a shared folder? I tried disk images attached from the shared folder first. Two of six clean builds hung for good, stuck in I/O, and only destroying the VM cleared them. USB hotplug never did that, so caches stay on USB. Build output itself stays on the VM&apos;s own disk, which is the fastest place for it. Putting &lt;code&gt;.build&lt;/code&gt; on the shared folder made a clean build 44% slower.&lt;/p&gt;
&lt;h2&gt;The Simulator rules&lt;/h2&gt;
&lt;p&gt;The compiler is half of it. The other half is how you run tests. The agent skill that ships with Cryo tells agents two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Boot one Simulator and reuse it for every run.&lt;/li&gt;
&lt;li&gt;Pass &lt;code&gt;-parallel-testing-enabled NO&lt;/code&gt; to &lt;code&gt;xcodebuild&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Parallel testing clones a Simulator for every run. In a VM that is slow and flaky, and the clones cost about 1 GB of lease disk each time. With one booted Simulator and no clones, the warm test run above went from 24 s to 4.7 s.&lt;/p&gt;
&lt;h2&gt;Putting it together&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;fresh lease, nothing warm           ~80–105 s first test run
+ warm-up build in the freeze       first iOS build 43 s → 21 s
+ cache disk from main              your packages are already there
+ one booted Simulator, no clones   warm test run 24 s → 4.7 s
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only measured on small packages so far.&lt;/strong&gt; A larger app pulling in more SDK frameworks may see different gains.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The image is big.&lt;/strong&gt; 56 GB for macOS, Xcode and the runtimes. Plan for about 150 GB free on the Mac.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The image is built from the Xcode on your Mac.&lt;/strong&gt; One Xcode per image; a new Xcode means a new image.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The image spec is at &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/image.md&quot;&gt;docs/spec/image.md&lt;/a&gt;, and the code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Give your agent a Mac over MCP</title><link>https://rizwan.dev/blog/2026-11-24_give-your-agent-a-mac-over-mcp/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-24_give-your-agent-a-mac-over-mcp/</guid><description>Cryo&apos;s MCP server gives a coding agent five tools to lease a clean macOS VM, run commands in it, copy files and give it back. Plus an agent skill that makes the agent reach for it by default.</description><pubDate>Tue, 24 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/give-your-agent-a-mac-over-mcp-light.svg&quot;
alt=&quot;cryo. Give your agent a Mac. An agent card calls lease_mac, run and release_mac over MCP, and a thawed Mac mini on the bay is leased to it.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/give-your-agent-a-mac-over-mcp-dark.svg&quot;
alt=&quot;cryo. Give your agent a Mac. An agent card calls lease_mac, run and release_mac over MCP, and a thawed Mac mini on the bay is leased to it.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo&lt;/a&gt; hands out clean macOS VMs from the Macs you already own. People can use it from the CLI. But I built it for agents, and agents talk to it over MCP.&lt;/p&gt;
&lt;p&gt;This post is about that part: the tools, the skill, and what a real session looks like.&lt;/p&gt;
&lt;h2&gt;Setup is one line&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo
claude mcp add cryo -- cryo mcp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is Claude Code. Any other MCP client takes the same thing as JSON:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{ &quot;mcpServers&quot;: { &quot;cryo&quot;: { &quot;command&quot;: &quot;cryo&quot;, &quot;args&quot;: [&quot;mcp&quot;] } } }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cryo mcp&lt;/code&gt; is an MCP server over stdio. It talks to the bay on your Mac, or to any bay you point it at.&lt;/p&gt;
&lt;h2&gt;Six tools&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lease_mac(folder?, cache?, name?)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lease a clean VM; returns an ID like &lt;code&gt;L81&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;run(lease, command, timeout?)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run a shell command; returns exit code, stdout, stderr&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;copy_in(lease, local, remote)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy files or folders into the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;copy_out(lease, remote, local)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy files or folders out&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;release_mac(lease, save_cache?)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Give the VM back and delete it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;status()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show the bay, its capsules, and the queue&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;That is the whole surface. I kept it small on purpose. An agent already knows how to use a shell. It does not need a tool for &lt;code&gt;xcodebuild&lt;/code&gt;, one for &lt;code&gt;swift test&lt;/code&gt; and one for the Simulator. It needs a Mac, a way to run commands in it, and a way to get files in and out.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;folder&lt;/code&gt; clones a local folder into the VM as the lease folder, at &lt;code&gt;/Volumes/My Shared Files&lt;/code&gt;. &lt;code&gt;cache&lt;/code&gt; attaches a named cache disk for DerivedData and packages, so the next lease for the same project starts warm.&lt;/p&gt;
&lt;h2&gt;The boring details that matter&lt;/h2&gt;
&lt;p&gt;A few things I only got right after watching agents use it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Leases renew themselves.&lt;/strong&gt; The MCP server renews its leases every minute and releases them when it exits. An agent that forgets to call &lt;code&gt;release_mac&lt;/code&gt; does not hold a Mac forever. An unused lease expires after about 5 minutes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No long waits.&lt;/strong&gt; When both VMs are busy, &lt;code&gt;lease_mac&lt;/code&gt; waits at most 30 seconds and then says &quot;call again&quot;. MCP clients give up on a call after about a minute. A longer wait would win a lease the agent no longer knows about.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeouts kill the work.&lt;/strong&gt; &lt;code&gt;run&lt;/code&gt; has a timeout (600 s by default, 3600 max). When it hits, the command&apos;s whole process group in the VM is killed, not just left running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output keeps the tail.&lt;/strong&gt; Long build logs keep only the end of each stream, about 100 KB. That is where the error is anyway.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The skill: use it by default&lt;/h2&gt;
&lt;p&gt;The MCP tools tell an agent what it &lt;em&gt;can&lt;/em&gt; do. The skill tells it &lt;em&gt;when&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The rule is simple: run builds, tests and Simulator sessions in a VM, not on the host. Even on a Mac that has Xcode installed. Do the same for untrusted code and for anything that installs tools.&lt;/p&gt;
&lt;p&gt;Why even on a Mac with Xcode? Because the host has my keychain, my SSH keys, my Simulators and my global tools. Nothing in a VM can touch them. And each lease starts clean, so two agents working in parallel do not fight over DerivedData, Simulators or ports.&lt;/p&gt;
&lt;p&gt;The skill also carries the rules I learned the hard way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Work in &lt;code&gt;/Volumes/My Shared Files&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Boot one Simulator and reuse it. Pass &lt;code&gt;-parallel-testing-enabled NO&lt;/code&gt; to &lt;code&gt;xcodebuild&lt;/code&gt;. Parallel testing clones Simulators, and in a VM that is slow and flaky.&lt;/li&gt;
&lt;li&gt;Never leave work only in the VM. Copy results out or push before you release. Release deletes everything.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Homebrew installs the skill with the binary. Link it for Claude Code with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkdir -p ~/.claude/skills
ln -s &quot;$(brew --prefix cryo)/share/cryo/skills/cryo&quot; ~/.claude/skills/cryo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cryo mcp&lt;/code&gt; also sends a short version of these rules when the client connects, so an agent without the skill still gets them.&lt;/p&gt;
&lt;p&gt;One honest note. The first version of the skill said to use Cryo on Linux, or when the host &quot;must stay clean&quot;. On my Mac, the agent read that, decided my Mac was fine, and never used it. The fix was to say &quot;by default, even on a Mac with Xcode&quot; in plain words. Agents do what the description says, not what you meant.&lt;/p&gt;
&lt;h2&gt;A real session&lt;/h2&gt;
&lt;p&gt;I gave Claude Code only the Cryo MCP tools and a small Swift package, and asked it to run the tests. It did this on its own:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lease_mac(folder: &quot;.&quot;)                         → L…
run(L…, &quot;swift test&quot;)                          → build 10.3 s, 1 test passed
run(L…, &quot;xcodebuild -version&quot;)                 → Xcode 27.2
copy_out(L…, &quot;…/results&quot;, &quot;./results&quot;)
release_mac(L…)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Six tool calls, 52 seconds end to end, including the build. It needed no help beyond the tool descriptions.&lt;/p&gt;
&lt;p&gt;The lease itself is the fast part. On my laptop, a lease came back in 227 to 397 ms, with macOS 27.2 and Xcode 27.2 inside.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; agent ──MCP──▶ cryo mcp ──▶ bay ──▶ capsule (clean macOS VM)
   ▲                                     │
   └──────── exit code, stdout, files ───┘
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;It works from Linux too&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;cryo mcp&lt;/code&gt; builds for Linux as a static binary. Point it at a bay on your network with &lt;code&gt;CRYO_URL&lt;/code&gt; and a token, and an agent on a Linux box gets a real Mac with Xcode when the task needs one. Most agent work does not need macOS. When it does, it shouldn&apos;t have to guess.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No screen.&lt;/strong&gt; The agent works over SSH. There is no way yet to watch the Simulator live from the agent&apos;s side.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs per Mac.&lt;/strong&gt; That is Apple&apos;s limit. A third agent waits in the queue.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing reaches back to your host.&lt;/strong&gt; A VM cannot call a dev server on your laptop. That is on purpose for now, but it means backend-dependent tests need another way in.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Try it&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo
cryo bay install
claude mcp add cryo -- cryo mcp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then ask your agent to run your tests &quot;in a clean Mac&quot;. The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>iOS CI on your own Mac minis</title><link>https://rizwan.dev/blog/2026-11-25_ios-ci-on-your-own-mac-minis/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-25_ios-ci-on-your-own-mac-minis/</guid><description>cryo-ci runs GitHub Actions jobs on clean macOS VMs from Macs you own. One job, one fresh VM, thrown away after. The same Macs serve your coding agents.</description><pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/ios-ci-on-your-own-mac-minis-light.svg&quot;
alt=&quot;cryo. iOS CI on your Mac minis. A GitHub Actions job running on a thawed Mac mini while the next capsule waits frozen.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/ios-ci-on-your-own-mac-minis-dark.svg&quot;
alt=&quot;cryo. iOS CI on your Mac minis. A GitHub Actions job running on a thawed Mac mini while the next capsule waits frozen.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo&lt;/a&gt; hands out clean macOS VMs from the Macs you already own. Agents use them over MCP. But the first real user of Cryo was not an agent. It was CI for my iOS app.&lt;/p&gt;
&lt;p&gt;This post is about &lt;strong&gt;&lt;a href=&quot;https://github.com/rizwankce/cryo-ci&quot;&gt;cryo-ci&lt;/a&gt;&lt;/strong&gt;: GitHub Actions jobs on capsules.&lt;/p&gt;
&lt;h2&gt;The setup&lt;/h2&gt;
&lt;p&gt;On the Mac that runs the bay:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo-ci
cryo-ci github login                     # a token with admin rights on the repo
cryo-ci install --repo owner/app         # runs as a LaunchAgent next to the bay
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the workflow, one label:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jobs:
  test:
    runs-on: cryo-xcode-27.2
    steps:
      - uses: actions/checkout@v4
      - run: xcodebuild test -scheme App -destination &apos;platform=iOS Simulator,name=iPhone 18 Pro&apos; -parallel-testing-enabled NO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is it. No runner to register by hand, no runner to keep alive, no runner to clean.&lt;/p&gt;
&lt;h2&gt;One job, one fresh VM&lt;/h2&gt;
&lt;p&gt;The usual self-hosted runner is one long-lived machine. Every job leaves something behind: a Simulator in a strange state, a full disk, a global tool someone installed. Over time the machine drifts, and you start debugging the runner instead of your app.&lt;/p&gt;
&lt;p&gt;cryo-ci never reuses a machine. Here&apos;s a job from start to finish:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; GitHub: job queued for runs-on: cryo-xcode-27.2
   1  cryo-ci polls queued jobs every 10 s
   2  leases a capsule (with the repo&apos;s cache disk)
   3  asks GitHub for a one-job runner config
   4  copies the runner into the VM and starts it
   5  GitHub runs the job: checkout, build, test
   6  runner exits → release → the VM is deleted → a fresh one thaws
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The runner registers for exactly one job and is gone after it. The VM is gone too. The next job gets a clean Mac, restored from the same frozen state.&lt;/p&gt;
&lt;p&gt;A few choices worth calling out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Polling, not webhooks.&lt;/strong&gt; No public URL, no tunnel into your home network. A poll every 10 seconds stays well inside GitHub&apos;s API limits for a few repos.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The runner is not in the image.&lt;/strong&gt; cryo-ci keeps the latest runner release on the host, checks its SHA-256 against the release notes, and copies it in per job. Images stay generic. Unpacking it on the VM disk takes about 2 seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lease first.&lt;/strong&gt; cryo-ci gets a VM before it asks GitHub for a runner. While the bay is full, nothing is registered, so no runner sits there waiting for a machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Labels from the image.&lt;/strong&gt; A bay offers &lt;code&gt;cryo&lt;/code&gt;, &lt;code&gt;cryo-&amp;lt;image tag&amp;gt;&lt;/code&gt; and &lt;code&gt;cryo-macos-27&lt;/code&gt;. A job that asks for a label the bay does not have is left for another runner.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Caches without trust problems&lt;/h2&gt;
&lt;p&gt;Each repo gets a cache disk for DerivedData and packages. Every job reads it. Only runs on the default branch save it back.&lt;/p&gt;
&lt;p&gt;That rule matters. A pull request can run any code it likes. If PR jobs could write the cache, one bad PR could poison every build after it. Reading is fine. Writing is for code that is already merged.&lt;/p&gt;
&lt;h2&gt;Real numbers&lt;/h2&gt;
&lt;p&gt;My iOS app&apos;s unit tests: 60 Swift Testing tests, built and run on the Simulator.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CI job, first run&lt;/td&gt;
&lt;td&gt;2 min 30 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI job, second run&lt;/td&gt;
&lt;td&gt;2 min 27 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI job, from a Homebrew install&lt;/td&gt;
&lt;td&gt;2 min 29 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Same build and test by hand (direct lease)&lt;/td&gt;
&lt;td&gt;128 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The job time covers checkout, build, Simulator boot and tests. The ~20 s gap over a manual lease is mostly GitHub Actions overhead. Getting the VM in the CI path took 2.5 to 3.4 seconds, most of it attaching the cache disk.&lt;/p&gt;
&lt;p&gt;Cryo&apos;s own CI runs on a bay too. &lt;code&gt;swift test&lt;/code&gt; plus a signed release build takes 1 min 36 s there. That job runs on pushes to &lt;code&gt;main&lt;/code&gt; only, so a pull request from a fork never reaches my Mac.&lt;/p&gt;
&lt;h2&gt;Agents and CI share the Macs&lt;/h2&gt;
&lt;p&gt;This is the part I like most. CI and agents use the same bay and the same queue.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; agents (MCP) ──┐
                ├──▶ bay queue ──▶ capsule 0
 GitHub jobs ───┘                  capsule 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A Mac mini running only CI sits idle most of the day. A Mac mini running only agents sits idle at night. On one queue, first come first served, the same two VMs do both.&lt;/p&gt;
&lt;h2&gt;What I learned running it&lt;/h2&gt;
&lt;p&gt;Running it for real found bugs that tests never did:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The label drifted.&lt;/strong&gt; My image tag changed, so the bay offered a label my workflow did not ask for. The job just sat queued. Nothing failed, which is worse.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Homebrew and launchd disagree on PATH.&lt;/strong&gt; cryo-ci runs as a LaunchAgent, and launchd&apos;s PATH does not include &lt;code&gt;/opt/homebrew/bin&lt;/code&gt;. Every job failed with &lt;code&gt;command not found: cryo&lt;/code&gt; until cryo-ci learned to find the Homebrew install itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binary overwritten in place gets killed.&lt;/strong&gt; Copying a new signed &lt;code&gt;cryo&lt;/code&gt; over the old file kept the inode, and macOS killed every launch after. The build script now writes a new file and renames it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The PATH and binary bugs are fixed in the current release. For labels, pin your workflow to one the bay offers, or use plain &lt;code&gt;cryo&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GitHub Actions only.&lt;/strong&gt; No other CI systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two jobs at a time per Mac.&lt;/strong&gt; Apple allows two macOS VMs per Mac. A third job waits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Mac stays logged in.&lt;/strong&gt; The bay and cryo-ci run as LaunchAgents in your session, and the GitHub token lives in your login Keychain.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Try it&lt;/h2&gt;
&lt;p&gt;You need a Mac with the &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;cryo&lt;/a&gt; bay set up first. Then:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo-ci
cryo-ci install --repo owner/app
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo-ci&quot;&gt;github.com/rizwankce/cryo-ci&lt;/a&gt;. If your iOS CI is a long-lived runner that slowly rots, I would love to hear how this compares.&lt;/p&gt;
</content:encoded></item><item><title>Two VMs per Mac</title><link>https://rizwan.dev/blog/2026-11-26_two-vms-per-mac/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-26_two-vms-per-mac/</guid><description>Apple allows two macOS VMs on a Mac, and the Virtualization framework enforces it. Here is how Cryo keeps both of them warm, refills one while the other is leased, and queues everything else.</description><pubDate>Thu, 26 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/two-vms-per-mac-light.svg&quot;
alt=&quot;cryo. Two VMs per Mac. A bay holds two warm capsules; a third restore fails with VZErrorDomain 6, maximum supported number of active virtual machines.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/two-vms-per-mac-dark.svg&quot;
alt=&quot;cryo. Two VMs per Mac. A bay holds two warm capsules; a third restore fails with VZErrorDomain 6, maximum supported number of active virtual machines.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;When I &lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;launched Cryo&lt;/a&gt; I wrote one line about the limit: &quot;Two capsules per Mac. That is Apple&apos;s limit, not mine.&quot;&lt;/p&gt;
&lt;p&gt;That line shapes most of the design, so this post is about it.&lt;/p&gt;
&lt;h2&gt;The limit is real, and paused VMs count&lt;/h2&gt;
&lt;p&gt;Apple&apos;s license allows two macOS VMs on a Mac you own or control. The Virtualization framework enforces it. On macOS 27.2 I restored two VMs, left them paused, and tried a third. The third restore failed with &lt;code&gt;VZErrorDomain 6&lt;/code&gt;: &quot;maximum supported number of active virtual machines&quot;.&lt;/p&gt;
&lt;p&gt;So a paused VM counts the same as a running one. There is no trick where you keep five VMs warm in RAM and only run two. A Mac holds two warm VMs, and that is all.&lt;/p&gt;
&lt;p&gt;The good news: a failed third start does not leak anything. Right after it, two VMs started fine.&lt;/p&gt;
&lt;h2&gt;Two capsules, two identities&lt;/h2&gt;
&lt;p&gt;Cryo calls each VM position a &lt;strong&gt;capsule&lt;/strong&gt;. A &lt;strong&gt;bay&lt;/strong&gt; is one Mac, and it runs two.&lt;/p&gt;
&lt;p&gt;You cannot restore the same saved state twice at once. A second restore of the same state, even from a copy of the file, fails while the first VM is alive. The machine identifier and the MAC address are baked into the saved state, and changing either breaks the restore.&lt;/p&gt;
&lt;p&gt;So each capsule is frozen on its own, with its own machine ID, its own MAC and its own subnet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  bay (one Mac)
  ├── capsule 0   own machine ID · own MAC · 10.77.0.0/24
  └── capsule 1   own machine ID · own MAC · 10.77.1.0/24
        both built from the same golden image on disk
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both share one read-only golden disk. Each lease gets a copy-on-write layer on top, which costs about 20 ms and close to zero bytes.&lt;/p&gt;
&lt;h2&gt;Keep both warm, all the time&lt;/h2&gt;
&lt;p&gt;If only two VMs can exist, the best thing they can do is be ready. A capsule waits restored and paused, with SSH already warm. A lease is just a resume plus one login.&lt;/p&gt;
&lt;p&gt;On my M1 Pro with an Xcode image and 8 GB capsules, a lease takes &lt;strong&gt;135–198 ms&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The slow part is the refill. When you release a lease, the bay stops the VM, throws away the lease&apos;s disk layer and key, and builds the next one:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;release ──▶ stop VM, delete lease layer           0.25–0.77 s
refill  ──▶ restore saved state
            resume, check SSH
            new host key, new hostname
            new per-lease SSH key
            3 warm-up logins
            pause                                  6–11 s total
lease   ──▶ resume + 1 login                       135–198 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All of the refill happens after the release and before the next lease. Nobody waits for it unless both capsules are busy.&lt;/p&gt;
&lt;h2&gt;When both are busy, you queue&lt;/h2&gt;
&lt;p&gt;Two capsules means a third request has to wait. The bay keeps one queue for everyone:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cryo lease                 # waits for a capsule (bay default)
cryo lease --wait 300      # waits up to 5 minutes
cryo lease --wait 0        # fails at once with no_capacity
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In my first tests a queued request was served 10.5 s after a release: that is one refill.&lt;/p&gt;
&lt;p&gt;The soak test shows what this looks like under load. Three clients on two capsules, 200 leases in a row, each one running over SSH, checking the capsule is clean and releasing. All 200 passed in 721 s. The median wait was 9.2 s and the longest was 14.4 s. That wait is the refill and nothing else.&lt;/p&gt;
&lt;h2&gt;Agents and CI share the queue&lt;/h2&gt;
&lt;p&gt;This is the part I like. An agent asking for a Mac over MCP and a GitHub Actions job from &lt;a href=&quot;https://github.com/rizwankce/cryo-ci&quot;&gt;cryo-ci&lt;/a&gt; go through the same bay and the same queue.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  agent (MCP) ──┐
  cryo lease  ──┼──▶ bay queue ──▶ capsule 0
  cryo-ci job ──┘                └▶ capsule 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A mini that only runs CI sits idle most of the day. A mini that only serves agents sits idle at night. One queue for both keeps it busy.&lt;/p&gt;
&lt;h2&gt;What two capsules cost&lt;/h2&gt;
&lt;p&gt;Each capsule holds its RAM while paused. With two 8 GB capsules, that is 16 GB held all the time. On a 32 GB Mac that leaves room for the host. On a 16 GB Mac mini, size the capsules smaller (e.g. 4–6 GB).&lt;/p&gt;
&lt;p&gt;Disk is cheaper than you think. Both capsules share the golden image, and a saved state is roughly the guest&apos;s resident memory, a few GB each.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No third warm VM.&lt;/strong&gt; Extra warmth can only be frozen state on disk, and a thaw from disk takes seconds, not milliseconds. I have not built that path.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No smart scheduling.&lt;/strong&gt; The queue is first in, first out. A CI job and an agent have the same priority.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More capacity means more Macs.&lt;/strong&gt; Two per Mac is the ceiling, so scaling out means adding another mini (which &lt;code&gt;cryo deck&lt;/code&gt; pools behind a single endpoint).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Try it&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo
cryo bay install
cryo status          # both capsules, thawed or refilling
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The bay&apos;s lease rules and queue are in &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/docs/spec/bay.md&quot;&gt;docs/spec/bay.md&lt;/a&gt;. The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Built to not leak</title><link>https://rizwan.dev/blog/2026-11-27_built-to-not-leak/</link><guid isPermaLink="true">https://rizwan.dev/blog/2026-11-27_built-to-not-leak/</guid><description>On a Mac that can run only two VMs, one leaked VM halves your capacity. How Cryo cleans up on every exit path, what the 200-lease soak test showed, and the one case it cannot fix by itself.</description><pubDate>Fri, 27 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img
src=&quot;/images/cryo/built-to-not-leak-light.svg&quot;
alt=&quot;cryo. Built to not leak. A leased Mac mini is stopped from the host in 0.25 to 0.77 s, leaving an empty slot: VM stopped, subnet free, disk and SSH key gone.&quot;
class=&quot;block dark:hidden&quot;
/&amp;gt;
&amp;lt;img
src=&quot;/images/cryo/built-to-not-leak-dark.svg&quot;
alt=&quot;cryo. Built to not leak. A leased Mac mini is stopped from the host in 0.25 to 0.77 s, leaving an empty slot: VM stopped, subnet free, disk and SSH key gone.&quot;
class=&quot;hidden dark:block&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/2026-11-17_cryo-frozen-macs-thawed-in-seconds/&quot;&gt;Cryo&lt;/a&gt; runs two macOS VMs per Mac. That is Apple&apos;s limit. It also means leaks hurt more than usual.&lt;/p&gt;
&lt;p&gt;On a Linux box, a stuck container costs you a bit of RAM. On a Mac with two VM slots, one leaked VM takes half the machine. Two take all of it. So I spent a lot of the build on cleanup.&lt;/p&gt;
&lt;h2&gt;What can leak&lt;/h2&gt;
&lt;p&gt;A lease is more than a VM. Each one has:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a running VM, which counts against the limit of two&lt;/li&gt;
&lt;li&gt;a network subnet held by macOS for that VM&lt;/li&gt;
&lt;li&gt;a copy-on-write disk layer&lt;/li&gt;
&lt;li&gt;a per-lease SSH key and a block in an SSH config&lt;/li&gt;
&lt;li&gt;a lease folder shared into the guest&lt;/li&gt;
&lt;li&gt;sometimes a cache disk attached over USB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Release has to undo all of it, every time, including when things go wrong.&lt;/p&gt;
&lt;h2&gt;Release is a host stop&lt;/h2&gt;
&lt;p&gt;The bay never asks the guest to shut down. It stops the VM from the host, syncs and detaches the cache disk, saves it, and deletes the rest. That takes &lt;strong&gt;0.25–0.77 s&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;A guest shutdown is slower, 7–8 s in my tests, and there is a worse reason to avoid it.&lt;/p&gt;
&lt;h2&gt;The VM-count leak&lt;/h2&gt;
&lt;p&gt;There are forum reports from macOS 26: after a guest shuts itself down, the host&apos;s VM counter stays one too high until a reboot. On a Mac capped at two, that is half your capacity gone until someone restarts the machine.&lt;/p&gt;
&lt;p&gt;I tested it on macOS 27.2 before trusting it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;100 leases released by host stop     → 2 VMs still start
 20 leases ended by guest shutdown   → 2 VMs still start
lease time across all of it           811–836 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No leak on 27.2. The bay still releases by host stop, because it is faster, and it keeps a watchdog in case a later macOS brings the bug back. If a refill is refused with the VM-limit error while fewer than two VMs run, &lt;code&gt;cryo doctor&lt;/code&gt; reports &quot;host accepts VMs&quot; as failing.&lt;/p&gt;
&lt;h2&gt;Every exit path&lt;/h2&gt;
&lt;p&gt;The bay tracks every VM it creates and stops them on every exit it can catch:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;VMs stopped&lt;/th&gt;
&lt;th&gt;Subnet after&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Normal shutdown&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SIGTERM&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl-C&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error with a VM running&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kill -9&lt;/code&gt;, VM paused&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kill -9&lt;/code&gt;, VM running&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;taken&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The last row is the one I cannot fix from inside the process. More on it below.&lt;/p&gt;
&lt;h2&gt;Cleaning up after the last bay&lt;/h2&gt;
&lt;p&gt;When a bay starts, it assumes the previous one may have crashed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It refuses to start if another bay is already running.&lt;/li&gt;
&lt;li&gt;It stops leftover Cryo processes that still hold VMs, so their own exit handlers free the subnets.&lt;/li&gt;
&lt;li&gt;It waits for macOS&apos;s VM service to finish tearing down before it starts new VMs. Without that wait, the first restore raced the old VM and got a false &quot;VM count leaked&quot; error.&lt;/li&gt;
&lt;li&gt;It undoes a freeze or image switch that a crash interrupted.&lt;/li&gt;
&lt;li&gt;It deletes half-built images. One Ctrl-C&apos;d image build left 26 GB behind before I added this.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And every SSH call the bay makes has keepalives and a time limit. Early on, a refill waited forever on a guest that had stopped answering.&lt;/p&gt;
&lt;h2&gt;The soak test&lt;/h2&gt;
&lt;p&gt;The repo has &lt;a href=&quot;https://github.com/rizwankce/cryo/blob/main/scripts/soak.sh&quot;&gt;&lt;code&gt;scripts/soak.sh&lt;/code&gt;&lt;/a&gt;. It runs N leases with M clients. Each lease runs over SSH, checks the capsule is clean, writes a marker for the next one to look for, and releases.&lt;/p&gt;
&lt;p&gt;I ran 200 leases with 3 clients on 2 capsules, so leases queued the whole time:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;leases ok           200 / 200      in 721 s
bay counters        +200 served, 0 failed
left behind         no lease, key, ssh_config block or lease folder
VM processes        2
bay open files      45 → 53
bay memory          34 → 36 MB
wait p50 / max      9.2 s / 14.4 s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It also found a bug. Both capsules were released in the same second, one stop took 1.4 s, and the refill right after was refused with the VM-limit error. Five seconds later it worked. The watchdog had called it a leak and said &quot;reboot the host&quot;. That was wrong: macOS was still settling. Now a VM-limit error during the quick retries counts as &lt;code&gt;settling&lt;/code&gt;, and only a third failure counts as a leak.&lt;/p&gt;
&lt;h2&gt;The one I cannot fix by itself&lt;/h2&gt;
&lt;p&gt;If the bay is killed with &lt;code&gt;kill -9&lt;/code&gt; while a VM is running, the VM&apos;s subnet stays taken. macOS&apos;s InternetSharing holds it, and in my tests it never let go on its own, even after 15 minutes. Restarting InternetSharing still requires sudo, though the bay now restarts itself afterward to recover cleanly.&lt;/p&gt;
&lt;p&gt;So the fix is manual:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo killall InternetSharing
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The bay makes this visible instead of failing quietly. &lt;code&gt;cryo status&lt;/code&gt; prints an &lt;code&gt;ALERT:&lt;/code&gt; line, and &lt;code&gt;cryo doctor&lt;/code&gt; names the command. It&apos;s rare — it takes a SIGKILL while a VM is running, which is not how a bay normally stops — but clearing the stuck subnet still needs that manual command.&lt;/p&gt;
&lt;h2&gt;What it does not do yet&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Recover from a SIGKILL without help.&lt;/strong&gt; See above.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reboot a host on a real leak.&lt;/strong&gt; The watchdog reports it. A person decides.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prove itself over weeks.&lt;/strong&gt; 200 leases is a good start. I am running it on my own CI to find what a longer run shows.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Try it&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;brew install rizwankce/tap/cryo
cryo bay install
cryo doctor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The code is at &lt;a href=&quot;https://github.com/rizwankce/cryo&quot;&gt;github.com/rizwankce/cryo&lt;/a&gt;. If you find something it leaves behind, I would love to hear about it.&lt;/p&gt;
</content:encoded></item><item><title>Blank SFSafariViewController</title><link>https://rizwan.dev/blog/blank_safari_viewcontroller/</link><guid isPermaLink="true">https://rizwan.dev/blog/blank_safari_viewcontroller/</guid><description>Possible fix for blank SFSafariViewController</description><pubDate>Mon, 08 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently We got continuous report from our clients saying they were getting blank In-App browser (&lt;code&gt;SFSafariViewController&lt;/code&gt;) instead of the web page it was intended to show. After a little bit of debugging I figured out that It was actually bug from iOS side.&lt;/p&gt;
&lt;p&gt;There is even a radar about it which you can find &lt;a href=&quot;http://openradar.appspot.com/22972440&quot;&gt;here&lt;/a&gt;. Looks like it was intentionally done by Apple. Here is the response from the radar&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is done to ensure SafariViewController can’t be used for loading content offscreen.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In our app, we don&apos;t actually load anything offscreen. There could be some delay to present the &lt;code&gt;SFSafariViewController&lt;/code&gt;. These are the possible fix I found on the internet.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make a delay before presenting the view controller&lt;/li&gt;
&lt;li&gt;Load the view before in hand&lt;/li&gt;
&lt;li&gt;Make the current window as key window&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Adding delay is not user friendly so let&apos;s not look into that.
Loading view before in hand works on some cases.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let controller = SFSafariViewController(url: url)
controller.delegate = self // load the view before in hand
present(controller, animated: true, completion: nil)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Other option would be make the current window as key window (only incase if you use multiple windows)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let window = &amp;lt;&amp;lt; your current window &amp;gt;&amp;gt;
window.makeKey()
let controller = SFSafariViewController(url: url)
controller.delegate = self
present(controller, animated: true, completion: nil)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What actually works for my case is to present the &lt;code&gt;SFSafariViewController&lt;/code&gt; from key window root view controller instead of some view controller in the view hierarchy.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; func openUrl(_ urlString: String, from viewController: UIViewController, completion: (() -&amp;gt; Swift.Void)? = nil) {
    guard let url = URL(string: urlString) else {
        showIncorrectUrlAlert(urlString, from: viewController)
        return
    }

    let vc = SFSafariViewController(url: url)
    vc.delegate = viewController as? SFSafariViewControllerDelegate
    // Present with window root view controller to avoid blank SFSafariViewController
    keyWindow?.rootViewController?.present(vc, animated: true, completion: nil)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My guess for this issue or fix would be disconnected view when you push safari view controller that causes window changes.&lt;/p&gt;
</content:encoded></item><item><title>Cleanup for &quot;Untitled&quot; tvOS App</title><link>https://rizwan.dev/blog/cleanup-for-untitled-tvos-app/</link><guid isPermaLink="true">https://rizwan.dev/blog/cleanup-for-untitled-tvos-app/</guid><description>How I cleaned up the MVP for the new tvOS app</description><pubDate>Wed, 05 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;So far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/new-xcode-project&quot;&gt;Initial Idea and tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/plan-for-untitled-tvos-app&quot;&gt;Planning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/mvp-for-untitled-tvos-app&quot;&gt;MVP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Cleanup&lt;/h2&gt;
&lt;p&gt;As I mentioned in my previous post, the initial MVP was okay with some quirks. My first goal was to get the app running reliably and worry about refinement later. To push it forward, I cycled through three tools and ran several sessions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Claude Code with Sonnet 4.5 for planning and Haiku 4.5 for todos&lt;/li&gt;
&lt;li&gt;Codex CLI with GPT Codex Medium&lt;/li&gt;
&lt;li&gt;Amp in free mode&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Amp had just released its free plan, and I wanted to try it that day. I had a perfect candidate, so I asked Amp CLI to fix issues one after another. When I wasn’t happy with the outputs, I moved to different agents.&lt;/p&gt;
&lt;p&gt;I solved the following issues and learned a lot about how IPTV works in the background. Some of it felt not entirely above board, but it’s strictly for personal use.&lt;/p&gt;
&lt;p&gt;Here are the main issues I worked through:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Made sure the API service was working by asking for a test file. Instead of running the app in the simulator every time, I wanted the agent to verify its own work.&lt;/li&gt;
&lt;li&gt;Correctly wired the API service so every endpoint and tab view behaved.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end I had a somewhat working app where I could log in, see folders, browse live channels, and even play them with the default &lt;code&gt;AVPlayer&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Satisfaction Level&lt;/h2&gt;
&lt;p&gt;But I wasn’t satisfied with the results. Here’s what I would have done better if I were building it myself:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The whole app had focus issues.&lt;/li&gt;
&lt;li&gt;Weird focus states with white borders.&lt;/li&gt;
&lt;li&gt;Card layouts looked rough.&lt;/li&gt;
&lt;li&gt;Live streaming stopped after one minute.&lt;/li&gt;
&lt;li&gt;Settings UI stretched awkwardly.&lt;/li&gt;
&lt;li&gt;Search didn’t work.&lt;/li&gt;
&lt;li&gt;Folder navigation felt clunky.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though the app technically ran, it still wasn’t usable. Up to this point I hadn’t reviewed the code much. I skimmed a few files, but because I’m still learning tvOS SwiftUI I assumed things were fine and accepted the changes.&lt;/p&gt;
&lt;p&gt;When I ran the app on Apple TV, I wasn’t happy with the outcome. I wanted a polished experience, and instead I found more problems with back-button behavior. So I stepped away—motivation gone.&lt;/p&gt;
</content:encoded></item><item><title>Hidden messages from Advent Of Code challenge</title><link>https://rizwan.dev/blog/Hidden-Message-Advent-Of-Code/</link><guid isPermaLink="true">https://rizwan.dev/blog/Hidden-Message-Advent-Of-Code/</guid><description>Hidden messages which came from Advent Of Code challenge</description><pubDate>Sun, 22 Dec 2019 06:44:02 GMT</pubDate><content:encoded>&lt;p&gt;Incase if you don&apos;t know &lt;a href=&quot;https://adventofcode.com/&quot;&gt;Advent Of Code&lt;/a&gt; is a small programming puzzles which can be solved in any programming language of your choice. It runs throughout the December and each day the complexity will increase.&lt;/p&gt;
&lt;p&gt;This year the over all theme was about Santa on some other planet and how we help him to reach earth on time for Christmas. I started little late on Day 2 and tried to catch up all 4 puzzles.&lt;/p&gt;
&lt;p&gt;Interesting thing I found today is one of the puzzle input was to figure out the input values to get output as &lt;code&gt;19690720&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you look closely to the value it&apos;s actually a Date - 1960/07/20. Which is the exact date of Apollo Moon landing. 🤯 Also lots of keywords and things used on Apollo Guidance computer like Noun and Verb. Never expected hidden messages from the puzzle. Good Job for the Apollo nostalgia &lt;a href=&quot;https://twitter.com/ericwastl&quot;&gt;Eric Wastl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;P.S: If you are following the advent calendar and wanted to check my solution in swift, you can check at this &lt;a href=&quot;https://github.com/rizwankce/AdventOfCode&quot;&gt;repo&lt;/a&gt; on Github. I will try to push it to GitHub whenever I found a solution.&lt;/p&gt;
</content:encoded></item><item><title>Homework for &quot;Untitled&quot; tvOS App</title><link>https://rizwan.dev/blog/home-work-for-untitled-tvos-app/</link><guid isPermaLink="true">https://rizwan.dev/blog/home-work-for-untitled-tvos-app/</guid><description>How I did the homework for the new tvOS app</description><pubDate>Thu, 06 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;So far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/new-xcode-project&quot;&gt;Initial Idea and tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/plan-for-untitled-tvos-app&quot;&gt;Planning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/mvp-for-untitled-tvos-app&quot;&gt;MVP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/cleanup-for-untitled-tvos-app&quot;&gt;Cleanup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Homework&lt;/h2&gt;
&lt;p&gt;The app wasn’t great. It was usable, but not even close to a four-star experience—more like a one-star prototype. I wanted to get it to at least four stars, so I did the one thing I hadn’t done yet: real homework, no LLMs involved.&lt;/p&gt;
&lt;p&gt;I’ve been building for Apple platforms since the pre-ARC iOS 5 days, and I usually follow a personal checklist for new apps. This time I skipped it, and the results made that obvious. Time to catch up.&lt;/p&gt;
&lt;h3&gt;Inspirations&lt;/h3&gt;
&lt;p&gt;First, I needed to study real-world apps and how their UI behaves. I installed a bunch of IPTV apps on Apple TV and tested almost all of them. One stood out: &lt;a href=&quot;https://apps.apple.com/us/app/uhf-love-your-iptv/id6443751726?platform=appleTV&quot;&gt;UHF&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I might have used an LLM here—I asked Perplexity for IPTV app inspiration. Reddit pointed me toward a few options, and that’s how I found UHF.&lt;/p&gt;
&lt;p&gt;I don’t know who built it, but it’s polished. The card layouts are great, everything feels snappy, and it has tons of features I hadn’t considered.&lt;/p&gt;
&lt;p&gt;Mad respect to that developer—they shipped it pre-LLM.&lt;/p&gt;
&lt;h3&gt;tvOS 101&lt;/h3&gt;
&lt;p&gt;Next, I needed to understand how modern tvOS apps are built with SwiftUI. What does it take to achieve that level of polish? So I did what any Apple platform developer would do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read Apple’s Human Interface Guidelines for tvOS.&lt;/li&gt;
&lt;li&gt;Watched relevant WWDC sessions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Turns out tvOS didn’t get major features this year. I expected some SwiftUI updates—maybe liquid glass on tvOS 18—but the best resource I found was from tvOS 17: a session about migrating TVML-based apps to SwiftUI, complete with a sample project. I ran the sample and it worked perfectly on tvOS 18.&lt;/p&gt;
&lt;p&gt;The session was &lt;a href=&quot;https://developer.apple.com/videos/play/wwdc2024/10207/&quot;&gt;WWDC24 session 10207: Migrate your TVML app to SwiftUI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After watching the session and running the sample in the simulator, I had a much better sense of how tvOS and SwiftUI fit together. Now I knew what I needed.&lt;/p&gt;
&lt;p&gt;What do you think I did next?&lt;/p&gt;
</content:encoded></item><item><title>Introducing vector-triage</title><link>https://rizwan.dev/blog/introducing-vector-triage/</link><guid isPermaLink="true">https://rizwan.dev/blog/introducing-vector-triage/</guid><description>Zero-config duplicate and similar detection for GitHub Issues and Pull Requests</description><pubDate>Sun, 15 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I just open-sourced &lt;strong&gt;vector-triage&lt;/strong&gt; over the weekend:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href=&quot;https://github.com/rizwankce/vector-triage&quot;&gt;https://github.com/rizwankce/vector-triage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It runs as a GitHub Action and helps detect duplicates and similar items for Issues and PRs.&lt;/p&gt;
&lt;p&gt;The idea started from a Twitter discussion when &lt;a href=&quot;https://x.com/steipete&quot;&gt;Pieter (@steipete)&lt;/a&gt; asked about this kind of feature in another OSS project. That project needed extra third-party dependencies for vector DB and embeddings. I wanted a simpler path for GitHub-native repos, so I built this around &lt;strong&gt;GitHub Models&lt;/strong&gt;, which are free for minimal usage.&lt;/p&gt;
&lt;h2&gt;What vector-triage is for&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;vector-triage&lt;/code&gt; is a GitHub Action that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;embeds issue/PR content with GitHub Models&lt;/li&gt;
&lt;li&gt;searches a local SQLite index (vector + FTS)&lt;/li&gt;
&lt;li&gt;posts one managed triage comment when related items are found&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It works for both Issues and Pull Requests.&lt;/p&gt;
&lt;h2&gt;Design goals&lt;/h2&gt;
&lt;p&gt;I kept the project focused on a few principles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;zero-config setup&lt;/li&gt;
&lt;li&gt;deterministic behavior&lt;/li&gt;
&lt;li&gt;low comment noise&lt;/li&gt;
&lt;li&gt;safe defaults for OSS repos&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Quick start&lt;/h2&gt;
&lt;p&gt;Setup is a single workflow file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: Triage

on:
  issues:
    types: [opened, edited]
  pull_request_target:
    types: [opened, synchronize]

permissions:
  contents: write
  issues: write
  pull-requests: write
  models: read

jobs:
  triage:
    runs-on: ubuntu-latest
    concurrency:
      group: triage-index
      cancel-in-progress: false
    steps:
      - uses: rizwankce/vector-triage@v1.0.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is the full setup.&lt;/p&gt;
&lt;h2&gt;How it behaves&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;First run: it creates the index and does not post noise comments.&lt;/li&gt;
&lt;li&gt;Later runs: if matches exist, it posts or updates one managed triage comment.&lt;/li&gt;
&lt;li&gt;If no matches are found, it stays quiet.&lt;/li&gt;
&lt;li&gt;Recoverable failures are logged as warnings and exit non-fatally.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Built with Codex&lt;/h2&gt;
&lt;p&gt;I built most of this in a weekend with the help of Codex.&lt;/p&gt;
&lt;p&gt;The biggest win was speed of iteration: shaping the retrieval behavior, comment format, and safety model quickly, then hardening with tests and E2E workflow checks.&lt;/p&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Repository: &lt;a href=&quot;https://github.com/rizwankce/vector-triage&quot;&gt;https://github.com/rizwankce/vector-triage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Action usage: &lt;code&gt;rizwankce/vector-triage@v1.0.2&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Kotlin and Android Native</title><link>https://rizwan.dev/blog/kotlin_and_android_native/</link><guid isPermaLink="true">https://rizwan.dev/blog/kotlin_and_android_native/</guid><description>Learning Kotlin and Android Native as an iOS developer</description><pubDate>Fri, 05 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Long time iOS developer, but never actually tried anything in Android world. Though I Worked on the cross-platform stack and tried out Android Studio before but never tried to learn Android Native Development. Always I hear about Android X, app compatibility and Gradle build from my colleagues. Even I went into a rabbit hole of upgrading React Native version and stuck because It&apos;s breaking the whole project due to the need for AndroidX support.&lt;/p&gt;
&lt;h2&gt;30DaysOfKotlin&lt;/h2&gt;
&lt;p&gt;Last May, when everyone was under lockdown and I saw a tweet about #30DaysOfKotlin. It&apos;s an online Bootcamp program which teaches Kotlin and Android Native development with a series of Offical tutorials (called Codelabs) and webinar from Google. I registered immediately. Then days passed I never got the chance to go through the code labs but watched the first live stream webinar and which got me some interest about Kotlin because of the similarity between Swift and Kotlin. Then I went through the code labs for &quot;Kotlin for Beginners&quot; and &quot;Android Kotlin fundamentals&quot;.&lt;/p&gt;
&lt;p&gt;As part of the program, I had to develop something on Kotlin and submit before June 6th 2020. Since all the modern apps are pretty much JSON viewer with better UX. I decided to build an app which consumes some sort of REST web service and build a minimal but functional app in the given time.&lt;/p&gt;
&lt;h2&gt;DevCast&lt;/h2&gt;
&lt;p&gt;DevCast - A developer-focused podcast app which is using Offical APIs from &lt;a href=&quot;https://dev.to&quot;&gt;dev.to&lt;/a&gt;. It has two screens, one to list the recent episodes and one for more details. The whole project itself open sourced and can be found &lt;a href=&quot;https://github.com/rizwankce/DevCast&quot;&gt;here&lt;/a&gt;. Project is released under MIT License so you can do anything with it.&lt;/p&gt;
&lt;p&gt;Here is the screenshots of the app. It has two screens, where first screen lists all the latest episodes from differnet podcast and second screen show the details of the selected episode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;These are some links where I learnt most about Kotlin and Android Native development. Incase if you would like to start your journey like me.&lt;/p&gt;
&lt;h3&gt;Google Codelabs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.android.com/courses/kotlin-bootcamp/overview?utm_source=week1&amp;amp;utm_medium=email&amp;amp;utm_campaign=30DaysOfKotlin&amp;amp;utm_term=Basic&quot;&gt;Kotlin Bootcamp for beginners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.android.com/courses/kotlin-android-fundamentals/overview?utm_source=week1&amp;amp;utm_medium=email&amp;amp;utm_campaign=30DaysOfKotlin&amp;amp;utm_term=Intermediate&quot;&gt;Android Kotlin Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.android.com/courses/kotlin-android-advanced/overview?utm_source=week1&amp;amp;utm_medium=email&amp;amp;utm_campaign=30DaysOfKotlin&amp;amp;utm_term=Advanced&quot;&gt;Advanced Android in Kotlin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://eventsonair.withgoogle.com/events/kotlin/resources&quot;&gt;All Kotlin resources from Google Codelabs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Others&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.raywenderlich.com/10529094-android-bootcamp&quot;&gt;Andriod Bootcamp by Raywenderlich&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=gDEGd174K_Q&amp;amp;list=WL&amp;amp;index=42&amp;amp;t=0s&quot;&gt;Andriod Crash Course for iOS developers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Learning SwiftUI with NetNewsWire</title><link>https://rizwan.dev/blog/learning-swiftui-with-netnewswire/</link><guid isPermaLink="true">https://rizwan.dev/blog/learning-swiftui-with-netnewswire/</guid><description>Learning SwiftUI by contributing to OSS</description><pubDate>Fri, 17 Jul 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;After the release of SwiftUI 2.0 on WWDC 2020, I got excited and want to learn more about it. What is better than learning a new tech by building a real-world app? Here it goes my learnings...&lt;/p&gt;
&lt;h2&gt;NetNewsWire&lt;/h2&gt;
&lt;p&gt;I got the chance to learn SwiftUI from an open-source project called &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire&quot;&gt;NetNewsWire&lt;/a&gt;. It&apos;s an RSS reader app for iOS, iPadOS and macOS. Build with UIKit/AppKit.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Shameless plug:- It&apos;s a cool app, you should check it out&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After the WWDC, contributors to the project had a zoom call and decided to hop on the SwiftUI train. It&apos;s not new for the team. They have already burnt the hand by investing some time last year when the SwiftUI 1.0 was released. For &lt;a href=&quot;https://inessential.com/2019/10/21/swiftui_is_still_the_future&quot;&gt;various reasons&lt;/a&gt; the team had to stop and rollback everything done on SwiftUI. Since there are lots of improvements on 2.0, we have decided to try it to build the existing multi-platform app with the all-new SwiftUI multiplatform.&lt;/p&gt;
&lt;p&gt;The whole team is ramping up with the latest cool beta things and I learnt a ton by implementing some small set of features on the Settings screen for iOS/iPadOS. One of my goals, when I started learning, is to share what I have learnt via blog posts. So I&apos;m gonna kick start a set of blog posts which explains specific new features from SwiftUI 2.0.&lt;/p&gt;
&lt;p&gt;The whole NetNewsWire community is great and I like to thank &lt;a href=&quot;https://twitter.com/brentsimmons&quot;&gt;Brent Simmons&lt;/a&gt; for creating this project and making it open-source, &lt;a href=&quot;https://twitter.com/vincode_io&quot;&gt;Maurice Parker&lt;/a&gt;,&lt;a href=&quot;https://twitter.com/stuarticus&quot;&gt;Stuart&lt;/a&gt; for helping me and correct my direction whenever I lost in track, and all other &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire/graphs/contributors&quot;&gt;contributors&lt;/a&gt; and users. If you would like to join, please check out our &lt;a href=&quot;https://ranchero.com/netnewswire/slack&quot;&gt;slack&lt;/a&gt; group. Everybody is welcome and encouraged to join.&lt;/p&gt;
</content:encoded></item><item><title>MVP for &quot;Untitled&quot; tvOS App</title><link>https://rizwan.dev/blog/mvp-for-untitled-tvos-app/</link><guid isPermaLink="true">https://rizwan.dev/blog/mvp-for-untitled-tvos-app/</guid><description>How I created an MVP for the new tvOS app</description><pubDate>Tue, 04 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;So far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/new-xcode-project&quot;&gt;Initial Idea and tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/plan-for-untitled-tvos-app&quot;&gt;Planning&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now, the actual MVP.&lt;/p&gt;
&lt;h2&gt;Phase 1&lt;/h2&gt;
&lt;p&gt;I was busy with other personal stuff and didn’t get a chance to work on the project. Around the same time, Claude launched Claude Code Web, so I spun up a new project session to try it out. I don’t know which model sits behind it, but my guess is Sonnet 4.5.&lt;/p&gt;
&lt;p&gt;My first session prompt was simple:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;i have milestones.md file.. please make sure that 1st milestone is complete or not. if not pls complete it
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It finished quickly—Milestone 1 was just “Project Setup &amp;amp; Configuration.”&lt;/p&gt;
&lt;p&gt;Then I spun up continuous sessions one after another. Each prompt followed the same pattern:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Please complete milestone 3 and 4 from milestones.md file
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The whole time, I wasn’t even in front of my computer. I kicked off sessions from both the iOS app and Claude Web.&lt;/p&gt;
&lt;p&gt;Afterward, I raised a PR for each session and merged them. It took roughly 30 minutes to complete 21 milestones. I didn’t review the code closely—everything came from Claude Web sessions—but I mainly needed the scaffolding in place so I could refine it later.&lt;/p&gt;
&lt;h2&gt;MVP&lt;/h2&gt;
&lt;p&gt;When I got back to my machine and pulled the latest changes, I was pleasantly surprised. All the files were there, and the project built just fine. I ran it on the tvOS simulator, and the login screen worked, aside from some focus quirks showing a weird white overlay. The app shipped with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tab view layout with four tabs&lt;/li&gt;
&lt;li&gt;Login screen&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nothing worked after login, though. The app couldn’t fetch data from the server and threw errors—no live channel lists, no folders.&lt;/p&gt;
</content:encoded></item><item><title>Network Activity logger for AFNetworking 3.0</title><link>https://rizwan.dev/blog/network-activity-logger-for-afnetworking-3-0/</link><guid isPermaLink="true">https://rizwan.dev/blog/network-activity-logger-for-afnetworking-3-0/</guid><description>Log all of your iOS project network activity to your console.</description><pubDate>Fri, 23 Dec 2016 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Log all of your iOS project network activity to your console.&lt;/p&gt;
&lt;p&gt;If you are an iOS developer (or Any mobile developer), you might be in a situation where you want to debug the network requests and responses for your app and figure out how exactly the app dealing with web services.&lt;/p&gt;
&lt;p&gt;With the help of &lt;a href=&quot;https://github.com/AFNetworking/AFNetworkActivityLogger/tree/master&quot;&gt;AFNetworkActivityLogger&lt;/a&gt; we can log all the details about the network operations to xCode console.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Incase if you are using swift and &lt;a href=&quot;https://github.com/Alamofire/Alamofire&quot;&gt;Alamofire&lt;/a&gt;, check out &lt;a href=&quot;https://github.com/Alamofire/AlamofireNetworkActivityIndicator&quot;&gt;AlamofireNetworkActivityIndicator&lt;/a&gt;. Everything below is covered for Obj-C&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;Install &lt;a href=&quot;http://cocoapods.org/&quot;&gt;Cocoapods&lt;/a&gt; if you don’t have already with the following command&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gem install cocoapods
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Note: CocoaPods version 0.39.0+ is required.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Podfile&lt;/h3&gt;
&lt;p&gt;To integrate &lt;a href=&quot;https://github.com/AFNetworking/AFNetworkActivityLogger/tree/master&quot;&gt;AFNetworkActivityLogger&lt;/a&gt; into your xCode project using Cocoapods, specify it in your Podfile&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;source &apos;https://github.com/CocoaPods/Specs.git&apos;
platform :ios, &apos;8.0&apos;

target &apos;TargetName&apos; do
pod &apos;AFNetworkActivityLogger&apos;
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above pod file integration will take the latest version from Github repo. Unfortunately the latest version only works with AFNetworking v2.0. Incase if you want to use it for AFNetworking v3.0 edit the pod file as below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pod ‘AFNetworkActivityLogger’, :git =&amp;gt; ‘https://github.com/AFNetworking/AFNetworkActivityLogger.git&apos;, :branch =&amp;gt; ‘3_0_0’
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above line will take the latest version from Git branch 3_0_0 which can be used with AFNetworking v3.0&lt;/p&gt;
&lt;h3&gt;Usage&lt;/h3&gt;
&lt;h4&gt;AFNetworking 3.0&lt;/h4&gt;
&lt;p&gt;Add the following code to &lt;code&gt;AppDelegate.m -application:didFinishLaunchingWithOptions:&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[[AFNetworkActivityLogger sharedLogger] startLogging];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ta-Da! now all your network activities will be logged in your Xcode console. By default log level is set as INFO, but incase if you want to see more logs follow the below lines.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;AFNetworkActivityConsoleLogger *logger = [AFNetworkActivityLogger sharedLogger].loggers.anyObject;
logger.level = AFLoggerLevelDebug;
[[AFNetworkActivityLogger sharedLogger] startLogging];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Supported log levels are&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AFLoggerLevelOff&lt;/code&gt;: Do not log requests or responses.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AFLoggerLevelDebug&lt;/code&gt; :Logs HTTP method, URL, header fields, &amp;amp; request body for requests, and status code, URL, header fields, response string, &amp;amp; elapsed time for responses.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AFLoggerLevelInfo&lt;/code&gt;: Logs HTTP method &amp;amp; URL for requests, and status code, URL, &amp;amp; elapsed time for responses.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AFLoggerLevelError&lt;/code&gt;: Logs HTTP method &amp;amp; URL for requests, and status code, URL, &amp;amp; elapsed time for responses, but only for failed requests.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;AFNetworking 2.0&lt;/h4&gt;
&lt;p&gt;If you are using version 2.0 follow the below code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[[AFNetworkActivityLogger sharedLogger] startLogging];
[[AFNetworkActivityLogger sharedLogger] setLevel:AFLoggerLevelError];
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>New Xcode Project - &quot;Untitled&quot; tvOS app</title><link>https://rizwan.dev/blog/new-xcode-project/</link><guid isPermaLink="true">https://rizwan.dev/blog/new-xcode-project/</guid><description>Sharing my experience of developing a tvOS app from scratch with help from LLMs</description><pubDate>Sun, 02 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Just like many Apple platform developers, I finally did the thing and clicked:&lt;/p&gt;
&lt;p&gt;Xcode → New Project&lt;/p&gt;
&lt;p&gt;To be honest, this isn’t the first time I’ve done it—I have plenty of private GitHub repos to prove it. But this time feels different. I have access to the tools that let me get that first push out quickly and even ship most of the app while I’m eating breakfast, thanks to LLM agents.&lt;/p&gt;
&lt;p&gt;I’ve been leaning on both CLI and cloud agents at work lately, so I wanted to try something new for a personal project.&lt;/p&gt;
&lt;p&gt;The plan: build an app from scratch with LLM help. Not AI slop or vibe coding, but a human-in-the-loop setup where I decide what hits GitHub instead of blindly accepting every suggestion a model produces.&lt;/p&gt;
&lt;h2&gt;Idea&lt;/h2&gt;
&lt;p&gt;The idea sparked a while ago: a live IPTV app. I live outside my home country and rely on Apple TV all the time, so I’ve wanted a solid IPTV experience tailored for me.&lt;/p&gt;
&lt;p&gt;I’ve never developed a tvOS app before, so this will be an experiment.&lt;/p&gt;
&lt;p&gt;PS: I’m sharing this after spending about two weeks building the app on and off.&lt;/p&gt;
&lt;h2&gt;Tool Belt&lt;/h2&gt;
&lt;p&gt;Things are moving fast in the LLM world, so my tool belt keeps changing with it. So far I’ve used the tools below and I’ll share more in upcoming blog posts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;Codex CLI&lt;/li&gt;
&lt;li&gt;Codex Web&lt;/li&gt;
&lt;li&gt;Claude Code Web&lt;/li&gt;
&lt;li&gt;Amp CLI&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Plan for &quot;Untitled&quot; tvOS App</title><link>https://rizwan.dev/blog/plan-for-untitled-tvos-app/</link><guid isPermaLink="true">https://rizwan.dev/blog/plan-for-untitled-tvos-app/</guid><description>How I planned the new tvOS app</description><pubDate>Mon, 03 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;a href=&quot;/blog/new-xcode-project&quot;&gt;I have an idea and prepped some tools for it&lt;/a&gt;. Now it’s time for planning. After creating a blank Xcode project, setting up a GitHub repo, and pushing the first commit, I avoided jumping straight into coding or asking an LLM to “build me this app.” Instead, I spent time planning.&lt;/p&gt;
&lt;h2&gt;Planning&lt;/h2&gt;
&lt;p&gt;I used Claude Web with Sonnet 4.5.&lt;/p&gt;
&lt;p&gt;I asked Claude to create a &lt;code&gt;spec.md&lt;/code&gt; file with milestones and phases for my tvOS project. This is the exact prompt I used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;create a spec.md file for my personal app (not gonna release it to stores)

idea is to have tv OS app which deos followings.
* allow me to enter xstream code (username, password and url)
* fetch all the deatils and load into the UI (use swift ui and apple provided apis)
* when clicking the item from the list use apple provided api to stream content.

before creating the md file. ask me questions and then make it
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I had to tell Claude that I’m not going to release it to stores because safety checks kicked in and refused to help with Xstream codes logins. Yes, I had misspelled a few things in the prompt.&lt;/p&gt;
&lt;p&gt;After I answered some of Claude’s questions, it generated a &lt;code&gt;spec.md&lt;/code&gt; file with two phases and lots of detail. Sharing just the phases here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Phase 1 - Core Functionality (MVP)

 Authentication with credential storage
 Fetch and display Live TV channels
 Fetch and display Movies
 Fetch and display TV Series with episode navigation
 Search across all content
 Video playback with full controls
 Settings screen with account management
 Metadata display (when available)

Phase 2 - Enhanced Experience (Future)

 Categories/Genre filtering
 Favorites list
 Recently watched
 Continue watching
 EPG support for Live TV
 Multi-account support
 Parental controls (if needed later)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I copied this &lt;code&gt;spec.md&lt;/code&gt; into my GitHub repo, created a new &lt;code&gt;docs&lt;/code&gt; folder, and saved it there.&lt;/p&gt;
&lt;h2&gt;Milestones&lt;/h2&gt;
&lt;p&gt;Back on my machine, I opened the repo with &lt;code&gt;spec.md&lt;/code&gt; and asked Claude Code with Sonnet 4.5 to create &lt;code&gt;docs/milestones.md&lt;/code&gt; by reading &lt;code&gt;docs/spec.md&lt;/code&gt;. After running for a bit, it produced 21 milestones for Phase 1 and 5 for Phase 2. It also added sections for “Suggested folder structure,” “Development Tips for LLM Implementation,” and “Common Pitfalls to Avoid.”&lt;/p&gt;
&lt;p&gt;I really liked the plan and only edited a few parts. &lt;code&gt;milestones.md&lt;/code&gt; is fairly long, so I’m sharing just one milestone here.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;## Milestone 15: Settings Screen

**Objective:** Create settings/account management interface.

**File to Create:** `Views/Settings/SettingsView.swift`

**Implementation Requirements:**

1. **Server Information Section:**
   - Display server URL (read-only)
   - Display username (read-only)
   - Display connection status

2. **Account Management Section:**
   - &quot;Change Account&quot; button
   - Confirms action with alert
   - Clears credentials from Keychain
   - Returns to login screen

3. **App Information Section:**
   - App version number
   - About text

4. **Cache Management Section:**
   - &quot;Clear Cache&quot; button
   - Clears URLCache
   - Shows confirmation

**Success Criteria:**
- [x] Server info displays correctly
- [x] Change Account button works
- [x] Logout clears credentials
- [x] Returns to login after logout
- [x] App version displays
- [x] Clear cache works
- [x] Proper alert confirmations
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next comes my favorite part—building the actual app from &lt;code&gt;spec.md&lt;/code&gt; and &lt;code&gt;milestones.md&lt;/code&gt;. What do you think I did, and how do you think the first version turned out?&lt;/p&gt;
</content:encoded></item><item><title>qmd for faster Obsidian search</title><link>https://rizwan.dev/blog/qmd-for-faster-obsidian-search/</link><guid isPermaLink="true">https://rizwan.dev/blog/qmd-for-faster-obsidian-search/</guid><description>How I made my markdown search fast with qmd in my Obsidian vault</description><pubDate>Tue, 27 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I use Claude Code and Codex to search my Obsidian vault. The problem is those agents often load big markdown files into context and burn tokens. I keep a lot of notes in Obsidian, and the vault is now big enough that search started to feel slow. I wanted something fast, local, and still markdown-first.&lt;/p&gt;
&lt;p&gt;I found &lt;strong&gt;qmd&lt;/strong&gt; (Quick Markdown Search). It’s a CLI search engine for markdown files. It mixes classic full-text search (BM25), vector search, and LLM re-ranking, and it runs locally. That mix is exactly what I wanted: fast keyword search when I know the words, and semantic search when I don’t.&lt;/p&gt;
&lt;h2&gt;What I set up&lt;/h2&gt;
&lt;p&gt;I pointed qmd at my Obsidian vault and created a collection for it. Then I added a short context string so I can filter results later. After that I generated embeddings once, and now I just query.&lt;/p&gt;
&lt;p&gt;Here’s the flow I’m using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# install
bun install -g https://github.com/tobi/qmd

# add my Obsidian vault
qmd collection add ~/Obsidian/Vault --name obsidian
qmd context add qmd://obsidian &quot;My Obsidian notes&quot;

# build embeddings once
qmd embed

# fast keyword search
qmd search &quot;work log okr&quot;

# semantic search
qmd vsearch &quot;what did i do on Jan first week?&quot;

# best quality (hybrid + reranking)
qmd query &quot;how I handle pagination in iOS app&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Why it feels faster&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It’s a CLI, so I can keep my flow in the terminal.&lt;/li&gt;
&lt;li&gt;Keyword search is instant for exact matches.&lt;/li&gt;
&lt;li&gt;Semantic search gives me the file I &lt;em&gt;meant&lt;/em&gt; even if I wrote different words.&lt;/li&gt;
&lt;li&gt;Everything stays local, which is important for my notes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How I use it with Obsidian&lt;/h2&gt;
&lt;p&gt;I still capture and edit in Obsidian. When I’m using Claude Code or Codex, I let the agent call qmd so it can search my vault fast without burning a bunch of context. For manual lookups, I jump to the terminal, run qmd, and then open the file in Obsidian.&lt;/p&gt;
&lt;p&gt;If you have a big markdown vault, give qmd a try. It feels like a power-up for Obsidian.&lt;/p&gt;
</content:encoded></item><item><title>Second Chance for &quot;Untitled&quot; tvOS App</title><link>https://rizwan.dev/blog/second-chance-for-untitled-tvos-app/</link><guid isPermaLink="true">https://rizwan.dev/blog/second-chance-for-untitled-tvos-app/</guid><description>How I gave the new tvOS app a second chance</description><pubDate>Fri, 07 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;So far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/new-xcode-project&quot;&gt;Initial Idea and tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/plan-for-untitled-tvos-app&quot;&gt;Planning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/mvp-for-untitled-tvos-app&quot;&gt;MVP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/cleanup-for-untitled-tvos-app&quot;&gt;Cleanup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/home-work-for-untitled-tvos-app&quot;&gt;Homework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Second Chance&lt;/h2&gt;
&lt;p&gt;After I created an MVP with LLM help, I wasn’t thrilled with the outcome. But now I had more knowledge about tvOS apps and a handful of solid inspirations.&lt;/p&gt;
&lt;p&gt;So I asked Codex CLI to make the app better. I pasted the WWDC session link and the HIG link into the prompt and told it to go to town.&lt;/p&gt;
&lt;p&gt;I wasn’t kidding—I was that literal. Turns out LLMs can’t browse Apple docs like we do. After a few rounds of trial and error, I found the reason and a workaround.&lt;/p&gt;
&lt;p&gt;I discovered &lt;a href=&quot;https://sosumi.ai/&quot;&gt;Sosumi&lt;/a&gt;, a handy tool that fetches Apple docs in an LLM-friendly format. I didn’t want to mess with an MCP server, so I dropped this note into my &lt;code&gt;AGENTS.md&lt;/code&gt;/&lt;code&gt;Claude.md&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Apple Developer Documentation Tip
If the developer.apple.com documentation portal isn’t returning readable content from automated tooling, replace the host with sosumi.ai to get an AI-friendly copy:

Original: https://developer.apple.com/documentation/swift/array
AI-readable: https://sosumi.ai/documentation/swift/array
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now Codex could see what I see on Apple’s site. It fetched the docs and listed a set of improvements. I told it, “All clear, go ahead with the plan.”&lt;/p&gt;
&lt;p&gt;Instead of fixing issues, it introduced more UI problems thanks to SwiftUI navigation quirks.&lt;/p&gt;
&lt;p&gt;I tried the same request with Claude and Amp, but neither produced useful results.&lt;/p&gt;
&lt;p&gt;So I restructured part of the app myself. I edited code in Xcode like it was the pre-LLM era—copying patterns from Apple’s sample project—and built a better card layout and navigation stack.&lt;/p&gt;
&lt;p&gt;For once, I was happy with the result. Then I asked Codex to mirror the first tab’s structure across the remaining tabs and navigation flows. The UI finally felt decent: fewer focus glitches, better navigation.&lt;/p&gt;
&lt;p&gt;I’d rate it 2.5 stars at that point.&lt;/p&gt;
&lt;p&gt;But the default &lt;code&gt;AVPlayer&lt;/code&gt; still didn’t work. After lots of conversations with ChatGPT, I learned it wasn’t an easy fix. My inspiration app had a setting to switch players and suggested VLC or KSPlayer.&lt;/p&gt;
&lt;p&gt;So I asked Codex CLI to create a new &lt;code&gt;VideoPlayerView&lt;/code&gt; based on VLC’s sample project. It one-shotted the feature, and I fixed the media streaming issue on top of that.&lt;/p&gt;
&lt;p&gt;The app finally bumped up to a solid three stars.&lt;/p&gt;
</content:encoded></item><item><title>Secure API Key Management with 1Password CLI</title><link>https://rizwan.dev/blog/secure-api-keys-with-1password-cli/</link><guid isPermaLink="true">https://rizwan.dev/blog/secure-api-keys-with-1password-cli/</guid><description>Stop storing API keys in plaintext shell configuration files and use 1Password CLI for secure access</description><pubDate>Thu, 14 Aug 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;We&apos;ve all been there - storing API keys directly in our &lt;code&gt;.zshrc&lt;/code&gt;, &lt;code&gt;.bashrc&lt;/code&gt;, or &lt;code&gt;.bash_profile&lt;/code&gt; files for easy access. While convenient, this approach has serious security implications. Your API keys are stored in plaintext, visible to anyone with access to your shell configuration, and at risk of being accidentally committed to version control.&lt;/p&gt;
&lt;h2&gt;The Problem with Plaintext Storage&lt;/h2&gt;
&lt;p&gt;The traditional approach looks like this in your &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export GEMINI_API_KEY=&quot;your-secret-api-key-here&quot;
export OPENAI_API_KEY=&quot;another-secret-key&quot;
export AWS_ACCESS_KEY_ID=&quot;yet-another-key&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This creates several security risks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plaintext exposure&lt;/strong&gt;: Keys are readable by any process or user with access to your shell files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version control leaks&lt;/strong&gt;: Easy to accidentally commit these files with sensitive data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System-wide access&lt;/strong&gt;: Any application can read these environment variables&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No audit trail&lt;/strong&gt;: No way to track when or how these keys are accessed&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Enter 1Password CLI&lt;/h2&gt;
&lt;p&gt;1Password CLI (&lt;code&gt;op&lt;/code&gt;) provides a secure way to store and retrieve sensitive information like API keys. Instead of storing keys in plaintext, we can store them securely in 1Password and retrieve them dynamically when needed.&lt;/p&gt;
&lt;h2&gt;Setup&lt;/h2&gt;
&lt;p&gt;First, install the 1Password CLI if you haven&apos;t already:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# macOS with Homebrew
brew install --cask 1password-cli

# Or download from https://1password.com/downloads/command-line/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, authenticate with your 1Password account:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;op account add
op signin
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Storing API Keys in 1Password&lt;/h2&gt;
&lt;p&gt;Create a new item in 1Password for your API key. You can do this through the 1Password app or CLI:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Create a new item with your API key
op item create --category=&quot;API Credential&quot; \
  --title=&quot;Gemini CLI&quot; \
  --field=&quot;password=your-actual-api-key-here&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Dynamic Key Retrieval&lt;/h2&gt;
&lt;p&gt;Now, instead of hardcoding the key in your &lt;code&gt;.zshrc&lt;/code&gt;, use the 1Password CLI to retrieve it dynamically:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# In your .zshrc file
export GEMINI_API_KEY=$(op item get &apos;Gemini CLI&apos; --fields password --reveal)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;--reveal&lt;/code&gt; flag ensures that the password field is displayed in plaintext for use as an environment variable.&lt;/p&gt;
&lt;h2&gt;Complete Shell Configuration&lt;/h2&gt;
&lt;p&gt;Here&apos;s how your &lt;code&gt;.zshrc&lt;/code&gt; might look with multiple API keys managed securely:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Secure API key management with 1Password CLI
export GEMINI_API_KEY=$(op item get &apos;Gemini CLI&apos; --fields password --reveal)
export OPENAI_API_KEY=$(op item get &apos;OpenAI API&apos; --fields password --reveal)
export AWS_ACCESS_KEY_ID=$(op item get &apos;AWS Credentials&apos; --fields username --reveal)
export AWS_SECRET_ACCESS_KEY=$(op item get &apos;AWS Credentials&apos; --fields password --reveal)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Benefits&lt;/h2&gt;
&lt;p&gt;This approach provides several advantages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Encrypted storage&lt;/strong&gt;: Keys are stored encrypted in 1Password&apos;s secure vault&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audit trail&lt;/strong&gt;: 1Password tracks access to your items&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Centralized management&lt;/strong&gt;: Manage all credentials from one secure location&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Easy rotation&lt;/strong&gt;: Update keys in 1Password without touching shell configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Safe version control&lt;/strong&gt;: Your &lt;code&gt;.zshrc&lt;/code&gt; can be safely committed without exposing secrets&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Performance Considerations&lt;/h2&gt;
&lt;p&gt;You might wonder about the performance impact of calling &lt;code&gt;op&lt;/code&gt; for each key. In practice, the CLI is quite fast, but if you&apos;re concerned about startup time, you could implement caching:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Cache keys for the session
if [[ -z &quot;$GEMINI_API_KEY&quot; ]]; then
    export GEMINI_API_KEY=$(op item get &apos;Gemini CLI&apos; --fields password --reveal)
fi
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Alternative: Session Management&lt;/h2&gt;
&lt;p&gt;For even better security, you can use 1Password&apos;s session management to avoid keeping long-running authenticated sessions:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Sign in and export session token
export OP_SESSION_my_account=$(op signin my_account --raw)

# Use the session token for subsequent calls
export GEMINI_API_KEY=$(op item get &apos;Gemini CLI&apos; --fields password --reveal --session=&quot;$OP_SESSION_my_account&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;By leveraging 1Password CLI, we can maintain the convenience of environment variables while significantly improving our security posture. Your API keys remain encrypted at rest, access is audited, and you eliminate the risk of accidentally exposing secrets in version control.&lt;/p&gt;
&lt;p&gt;The small performance overhead is a worthwhile trade-off for the security benefits, and your future self will thank you for taking the extra step to protect your valuable API credentials.&lt;/p&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.1password.com/docs/cli/&quot;&gt;1Password CLI documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://1password.com/downloads/command-line/&quot;&gt;1Password CLI installation guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>📸 Swift Camera — Part 1</title><link>https://rizwan.dev/blog/swift-camera-part-1/</link><guid isPermaLink="true">https://rizwan.dev/blog/swift-camera-part-1/</guid><description>Create a custom camera view using AVFoundation</description><pubDate>Fri, 16 Jun 2017 13:28:59 GMT</pubDate><content:encoded>&lt;p&gt;Create a custom camera view using AVFoundation&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Photo credit: &lt;a href=&quot;https://unsplash.com/search/iphone-camera?photo=eX5CeferlDo&quot;&gt;unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;iOS 11 brings lots of new cool features like Machine Learning and Augmented Reality. So you might want to test those features or create awesome apps. But if you notice that some of them need a custom camera and accessing camera frames. iOS have lots of API’s for us to access device camera, capture image and process it. &lt;code&gt;AVFoundation&lt;/code&gt; is the framework you should be looking at. Since this framework is huge and there is lots of ways to achieve the desired features I decided to write set of blog posts about the following.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create custom camera view&lt;/li&gt;
&lt;li&gt;Take picture from custom camera&lt;/li&gt;
&lt;li&gt;Record Video using&lt;/li&gt;
&lt;li&gt;Detect Face and Scan QR code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;(If you want some specific things please do ask me in the comments. I will try to write/learn about it)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To all those nerds who wants to skip the blog post and see the code in action. I got you covered. Here is the Github Repo. Keep an eye on this repo because I will be adding all features in the same app and if you want to improve the code quality PR/Issues are welcome.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rizwankce/Camera/&quot;&gt;rizwankce/Camera&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For others,&lt;/p&gt;
&lt;h1&gt;Let’s create a custom camera&lt;/h1&gt;
&lt;h2&gt;Step 1:&lt;/h2&gt;
&lt;p&gt;Create new project in xCode by selecting File → New → Project → Single View Application (under iOS tab)&lt;/p&gt;
&lt;p&gt;Give it a nice name and select swift as Language. Click Next → Create and save the project file. if everything goes well, you could see a project like below&lt;/p&gt;
&lt;p&gt;&amp;lt;p align=&quot;center&quot;&amp;gt;
&amp;lt;img src=&quot;https://cdn-images-1.medium.com/max/800/1*hoxX5t0dPha_Y4XzMFucCQ.png&quot;&amp;gt;
&amp;lt;br/&amp;gt;
Project structure
&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;h2&gt;Step 2:&lt;/h2&gt;
&lt;p&gt;Select Main.storyboard ,drag &lt;code&gt;UIView&lt;/code&gt; to your view controller and set top , bottom , leading, trailing to 0. This view will serve as “view finder” or “preview view” for your camera.&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;
&amp;lt;p align=&quot;center&quot;&amp;gt;
&amp;lt;img src=&quot;https://cdn-images-1.medium.com/max/800/1&lt;em&gt;mvbETYE-5CJa6t_ZlxjOtg.png&quot;&amp;gt;
&amp;lt;br/&amp;gt;
Main.storyboard ViewController structure
&amp;lt;/p&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;p align=&quot;center&quot;&amp;gt;
&amp;lt;img src=&quot;https://cdn-images-1.medium.com/max/800/1&lt;/em&gt;wUAgn8DwN0rXZ65Tcak4Xw.png&quot;&amp;gt;
&amp;lt;br/&amp;gt;
Preview View Constraints
&amp;lt;/p&amp;gt;
&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;Control + drag our preview view to &lt;code&gt;ViewController.swift&lt;/code&gt; and create an IBOutlet named &lt;code&gt;previewView&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Step 3&lt;/h2&gt;
&lt;p&gt;At the top of your ViewController file, import &lt;code&gt;AVFoundation&lt;/code&gt; framework.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import AVFoundation
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create the below instance variables so that we can access anywhere in the ViewController file.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var captureSession: AVCaptureSession?
var videoPreviewLayer: AVCaptureVideoPreviewLayer?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;here &lt;code&gt;captureSession&lt;/code&gt; helps us to transfer data between one or more device inputs like camera or microphone and view &lt;code&gt;videoPreviewLayer&lt;/code&gt; helps to render the camera view finder in our ViewController&lt;/p&gt;
&lt;h2&gt;Step 4&lt;/h2&gt;
&lt;p&gt;You will need a capture device, device input and preview layer to setup and start the camera. To make it simpler we will try to do everything related to camera setup in &lt;code&gt;viewDidLoad&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Get an instance of the AVCaptureDevice class to initialise a device object and provide the video as the media type parameter. You can even select which capture device you can choose like a dual camera or standard camera but for this post, we will just get default device (rear camera).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let captureDevice = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Get an instance of the AVCaptureDeviceInput class using the previous device object. This will serve as a middle man to attach our input device to capture device. Here there is a chance that input device might not be available, so wrap it inside a do…catch to handle errors&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;do {
let input = try AVCaptureDeviceInput(device: captureDevice)
} catch {
print(error)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Initialise our &lt;code&gt;captureSession&lt;/code&gt; object and add the input device to our session&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;captureSession = AVCaptureSession()
captureSession?.addInput(input)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next configure our preview View so that we can see the live preview of camera.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an &lt;code&gt;AVCaptureVideoPreviewLayer&lt;/code&gt; from our session&lt;/li&gt;
&lt;li&gt;Configure the layer to resize while maintaining original aspect&lt;/li&gt;
&lt;li&gt;Set preview layer frame to our ViewController view bounds&lt;/li&gt;
&lt;li&gt;Add the preview layer as sublayer to our &lt;code&gt;previewView&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
videoPreviewLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill
videoPreviewLayer?.frame = view.layer.bounds
previewView.layer.addSublayer(videoPreviewLayer!)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, start our &lt;code&gt;captureSession&lt;/code&gt; to start video capture&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;captureSession?.startRunning()
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 5&lt;/h2&gt;
&lt;p&gt;Since the simulator does NOT have a camera to check our code. you might need a real device to run the code. So connect your phone and hit run, you should be see a live camera.&lt;/p&gt;
&lt;p&gt;Meh! The app will crash because we forgot to add one last thing. That is “Privacy — Camera Usage Description” in our plist. Add this to Info.plist file and give some nice message because that is what user will see when app is requesting for camera permission.&lt;/p&gt;
&lt;p&gt;Now if you hit run you should be seeing the magic!&lt;/p&gt;
&lt;p&gt;There are some things which I haven’t included here like checking user permission, adding capture output. But if you got the time you can read about all of them in Apple Documentation here.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/PhotoCaptureGuide/&quot;&gt;Photo Capture Programming Guide
&lt;/a&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/PhotoCaptureGuide/&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;On next part, I will write about having &lt;code&gt;AVCapturePhotoOutput&lt;/code&gt; and use its delegate method to take a picture and save it to iPhone Camera Roll. Follow me here or on &lt;a href=&quot;https://twitter.com/rizzu26&quot;&gt;twitter&lt;/a&gt; to get updates. If you like this post share and comments&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr /&gt;
</content:encoded></item><item><title>📸 Swift Camera — Part 2</title><link>https://rizwan.dev/blog/swift-camera-part-2/</link><guid isPermaLink="true">https://rizwan.dev/blog/swift-camera-part-2/</guid><description>Use custom camera view to take pictures and save it to photos album</description><pubDate>Tue, 20 Jun 2017 12:01:15 GMT</pubDate><content:encoded>&lt;p&gt;Use custom camera view to take pictures and save it to photos album&lt;/p&gt;
&lt;p&gt;
Photo credit: &lt;a href=&quot;https://unsplash.com/search/iphone-take?photo=PnyS8tiGdbo&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Incase this is your first time here, you can go ahead read the part 1. Believe me — it would only take you 4 mins to read it. I explained in detail about “How to create custom camera view using &lt;code&gt;AVFoundation&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/swift-camera-part-1/&quot;&gt;📸 Swift Camera — Part 1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As usual, to all those nerds who wants to see the code in action and skip this post. Here is your Github repo link. Everything I am gonna discuss is already in that repo master branch.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rizwankce/Camera&quot;&gt;rizwankce/Camera&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For others who want to learn before diving into code,&lt;/p&gt;
&lt;h1&gt;&lt;strong&gt;Let’s take pictures with our custom camera&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;Before you dive in, you need the code from Part 1. You can find it in this &lt;a href=&quot;https://github.com/rizwankce/Camera/tree/feature/custom-camera&quot;&gt;Github branch&lt;/a&gt;. Below steps will use the part 1 view controller and add a feature to taking pictures.&lt;/p&gt;
&lt;h2&gt;Step 1&lt;/h2&gt;
&lt;p&gt;Select Main.storyboard, drag &lt;code&gt;UIButton&lt;/code&gt; to our view controller, give it a nice title like “Snap a photo” and set constraints. Make sure button is on top of the preview view like below.&lt;/p&gt;
&lt;p&gt;&amp;lt;p align=&quot;center&quot;&amp;gt;
&amp;lt;img src=&quot;https://cdn-images-1.medium.com/max/800/1*ul8unoF8WI3gkcVJotHoMQ.png&quot;&amp;gt;
&amp;lt;br/&amp;gt;
Main.storyboard ViewController structure
&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;Set below constraints for our button, So that it will be in correct position.&lt;/p&gt;
&lt;p&gt;&amp;lt;p align=&quot;center&quot;&amp;gt;
&amp;lt;img src=&quot;https://cdn-images-1.medium.com/max/800/1*rHzGPk6R8CNpy26m8VVzaw.png&quot;&amp;gt;
&amp;lt;br/&amp;gt;
Capture button constraints
&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;Here, I’m adding leading, trailing and bottom constraints to our capture button. So that our button will be placed the bottom of the screen.&lt;/p&gt;
&lt;p&gt;Control + drag our button to &lt;code&gt;ViewController.swift&lt;/code&gt; and create an IBOutlet action like below. This function will be called when we tap the capture button.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@IBAction func onTapTakePhoto(_ sender: Any) {

}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 2&lt;/h2&gt;
&lt;p&gt;Create below instance variable in our ViewController.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var capturePhotoOutput: AVCapturePhotoOutput?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here &lt;code&gt;capturePhotoOutput&lt;/code&gt; helps us to snap a photo from our capture session. It has also provided lots of modern interface for capturing still photo, Live photo, wide-gamut colour including the variety of formats. To simplify this post, we are going to take still image from our capturePhotoOutput.&lt;/p&gt;
&lt;h2&gt;Step 3&lt;/h2&gt;
&lt;p&gt;Create an instance of AVCapturePhotoOutput in our &lt;code&gt;viewDidLoad&lt;/code&gt; method inside do…catch loop and add it to our session as output like below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Get an instance of ACCapturePhotoOutput class
capturePhotoOutput = AVCapturePhotoOutput()
capturePhotoOutput?.isHighResolutionCaptureEnabled = true

// Set the output on the capture session
captureSession?.addOutput(capturePhotoOutput)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/documentation/avfoundation/avcapturephotooutput&quot;&gt;AVCapturePhotoOutput&lt;/a&gt; has lots of properties to control how the capture workflow should work. But we are just enabling High resolution capture here.&lt;/p&gt;
&lt;h2&gt;Step 4&lt;/h2&gt;
&lt;p&gt;Create and configure Photo Settings in our &lt;code&gt;onTapTakePhoto&lt;/code&gt; function like below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Make sure capturePhotoOutput is valid
guard let capturePhotoOutput = self.capturePhotoOutput else { return }

// Get an instance of AVCapturePhotoSettings class
let photoSettings = AVCapturePhotoSettings()

// Set photo settings for our need
photoSettings.isAutoStillImageStabilizationEnabled = true
photoSettings.isHighResolutionPhotoEnabled = true
photoSettings.flashMode = .auto

// Call capturePhoto method by passing our photo settings and a
// delegate implementing AVCapturePhotoCaptureDelegate
capturePhotoOutput.capturePhoto(with: photoSettings, delegate: self)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, create an instance of &lt;code&gt;AVCapturePhotoSettings&lt;/code&gt; and set some photo settings like image stabilisation, high resolution photo and auto flash mode.&lt;/p&gt;
&lt;p&gt;Then, call &lt;code&gt;capturePhoto&lt;/code&gt; method from &lt;code&gt;capturePhotoOutput&lt;/code&gt; instance and pass our photo settings with self as delegate. This will allow us to take a still image from our custom camera.&lt;/p&gt;
&lt;h2&gt;Step 5&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate&quot;&gt;AVCapturePhotoCaptureDelegate&lt;/a&gt; methods gives us lots of control over a photo capture output. To simply our needs we will use this below method to get the captured image.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;photoOutput(_:didFinishProcessingPhoto:previewPhoto:resolvedSettings:bracketSettings:error:)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Create an extension for ViewController and extends from AVCapturePhotoCaptureDelegate like below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;extension ViewController : AVCapturePhotoCaptureDelegate {
    func capture( captureOutput: AVCapturePhotoOutput,
                  didFinishProcessingPhotoSampleBuffer photoSampleBuffer: CMSampleBuffer?,
                  previewPhotoSampleBuffer: CMSampleBuffer?,
                  resolvedSettings: AVCaptureResolvedPhotoSettings,
                  bracketSettings: AVCaptureBracketedStillImageSettings?,
                  error: Error?) {
        // get captured image
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;didFinishProcessingPhotoSampleBuffer&lt;/code&gt; gives us the captured photo buffer ,preview buffer and resolved photo settings.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Make sure we get some photo sample buffer
guard error == nil,
    let photoSampleBuffer = photoSampleBuffer else {
        print(&quot;Error capturing photo: \(String(describing: error))&quot;)
        return
}

// Convert photo same buffer to a jpeg image data by using // AVCapturePhotoOutput
guard let imageData =
    AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer) else {
        return
}

// Initialise a UIImage with our image data
let capturedImage = UIImage.init(data: imageData , scale: 1.0)
if let image = capturedImage {
    // Save our captured image to photos album
    UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, we are getting only photoSampleBuffer. Need to convert it to a jpeg image data. To do that we can use &lt;code&gt;jpegPhotoDataRepresentation&lt;/code&gt; method from &lt;code&gt;AVCapturePhotoOutput&lt;/code&gt; which will take photo sample buffer and preview photo same buffer as input and gives us JPEG image data.&lt;/p&gt;
&lt;p&gt;To save our captured image to photos album, again we need to convert our image data to &lt;code&gt;UIImage&lt;/code&gt; . So initialise an &lt;code&gt;UIImage&lt;/code&gt; by passing our jpeg Image Data and scale of 1.0.&lt;/p&gt;
&lt;p&gt;Finally, use &lt;code&gt;UIImageWriteToSavedPhotoAlbum&lt;/code&gt; method and pass our image to be saved in photo album.&lt;/p&gt;
&lt;h2&gt;Step 6&lt;/h2&gt;
&lt;p&gt;if you run the app in a real device, it might crash now by giving below message.&lt;/p&gt;
&lt;p&gt;
Console message on Crash&lt;/p&gt;
&lt;p&gt;You guessed it correct! we need to add “Privacy — Photo Library Usage Description” in our plist. Since we are saving the image to photo library.#&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT from future&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To prevent crashes on iOS 11, “Privacy — Photo Library Additions Usage Description” in info.plist with a usage description (string) should be added.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href=&quot;https://medium.com/u/3e146f6d92fa&quot;&gt;Ingrid Silapan&lt;/a&gt; for pointing this out!&lt;/p&gt;
&lt;p&gt;Now if you hit run and click the button at the bottom. You will hear a sound indicating the camera is taking picture. Go ahead and check in your photos app to verify the captured image is actually saved or not.&lt;/p&gt;
&lt;p&gt;There are lots of things I haven’t included here. So I am trying to list as much as possible below.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AVCapturePhotoOutput&lt;/code&gt; class supports only from iOS 10 and above. So if you are targeting any iOS below then 10. You should be checking out &lt;code&gt;[AVCaptureStillImageOutput](https://developer.apple.com/documentation/avfoundation/avcapturestillimageoutput)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[didFinishProcessingPhotoSampleBuffer](https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate/2873949-photooutput)&lt;/code&gt; is deprecated from iOS 11. But you can use &lt;code&gt;didFinishProcessingPhoto&lt;/code&gt; method from &lt;code&gt;AVCapturePhotoOutputDelegate&lt;/code&gt; to achieve the same for iOS 11&lt;/li&gt;
&lt;li&gt;The reason these photo taking API’s from Apple is deprecated and added for every major release is that every major iOS release is included with lots of feature for photo capture. Do you know that you can take the RAW image file and save it as DNG and can be edited with your favourite photo editing app without losing any image data? Yes, its possible from iOS 10&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AVCapturePhotoOutput&lt;/code&gt; is so powerful that we need to take a bit more time to avoid errors. I would suggest reading more on &lt;a href=&quot;https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/PhotoCaptureGuide/&quot;&gt;“Photo Capture programming guide”&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;To save image to photos album we have used &lt;code&gt;UIImageWriteToSavedPhotoAlbum&lt;/code&gt; method. But if you want more control over saving photos, you need to check out &lt;code&gt;[PHPhotoLibrary](https://developer.apple.com/documentation/photos/phphotolibrary)&lt;/code&gt; Since photos app is become so powerful, starting from iOS 8 now we have more control over Photo Library as well.&lt;/li&gt;
&lt;li&gt;Having a “Snap a photo” button seems to be old-school. So I created a rounded white background button and the same code is available in Github repo.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;On next part, I will write about detect QR code or Face from our custom camera view. Follow me here or on &lt;a href=&quot;https://twitter.com/rizzu26&quot;&gt;twitter&lt;/a&gt; to get updates. If you like this post please share and recommend.&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded></item><item><title>📸 Swift Camera — Part 3</title><link>https://rizwan.dev/blog/swift-camera-part-3/</link><guid isPermaLink="true">https://rizwan.dev/blog/swift-camera-part-3/</guid><description>Use custom camera view to detect QR code</description><pubDate>Wed, 05 Jul 2017 08:59:57 GMT</pubDate><content:encoded>&lt;p&gt;Use custom camera view to detect QR code&lt;/p&gt;
&lt;p&gt;
Photo by Nadine Shaabana on &lt;a href=&quot;https://unsplash.com/search/iphone?photo=vuec_Nz_FnA&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is third part of “Swift Camera” series. You can check those from below&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/swift-camera-part-1/&quot;&gt;📸 Swift Camera — Part 1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/swift-camera-part-2/&quot;&gt;📸 Swift Camera — Part 2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As usual, project code is available in Github from all parts.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rizwankce/Camera/&quot;&gt;rizwankce/Camera&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Before we dive in, you need to check the code from Part 1 where we discuss about creating custom camera view. Below steps will use the same view controller as other part and add detecting QR code feature to it.&lt;/p&gt;
&lt;p&gt;AVFoundation provides set of API’s to detect the barcodes from our custom camera. To check the list of supported barcode type check &lt;a href=&quot;https://developer.apple.com/documentation/avfoundation/avmetadataobject.objecttype&quot;&gt;AVMetadataObject.ObjectType&lt;/a&gt; . In this post we will learn about detecting QR (Quick Response) code.&lt;/p&gt;
&lt;h2&gt;Step 1&lt;/h2&gt;
&lt;p&gt;Create an instance of &lt;code&gt;AVCaptureMetaDataOutput&lt;/code&gt; in our &lt;code&gt;viewDidLoad&lt;/code&gt; method inside do…catch loop and add it to our session as output like below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Initialize a AVCaptureMetadataOutput object and set it as the
// input device
let captureMetadataOutput = AVCaptureMetadataOutput()
captureSession?.addOutput(captureMetadataOutput)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To make a note our captureSession can add more then one output. In our example we are having &lt;code&gt;AVCapturePhotoOuput&lt;/code&gt; and &lt;code&gt;AVCaptureMetadataOutput&lt;/code&gt; to simultaneously take photo or read meta data from single camera view.&lt;/p&gt;
&lt;h2&gt;Step 2&lt;/h2&gt;
&lt;p&gt;Set delegate for MetadataObjectsDelegate and metadataObjectTypes like below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Set delegate and use the default dispatch queue to execute the
// call back
captureMetadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)
captureMetadataOutput.metadataObjectTypes =\[AVMetadataObjectTypeQRCode\]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, meta data object delegate requires a dispatch queue. To simplify it, we are going with Main queue. But for production application it’s better to create a serial queue for our delegate.&lt;/p&gt;
&lt;p&gt;Let &lt;code&gt;captureMetadataOutput&lt;/code&gt; know what type of object types we need to detect. It accepts array of meta data types. If you want to detect all supported types just list them in an array.&lt;/p&gt;
&lt;h2&gt;Step 3&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;AVCaptureMetadataOutputObjectsDelegate&lt;/code&gt; methods gives us meta data objects which was detected from our capture session.&lt;/p&gt;
&lt;p&gt;Create an extension for ViewController and extends from &lt;code&gt;AVCaptureMetadataOutputObjectsDelegate&lt;/code&gt; like below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;extension ViewController : AVCaptureMetadataOutputObjectsDelegate {

    func captureOutput(\_ captureOutput: AVCaptureOutput!,
        didOutputMetadataObjects metadataObjects: \[Any\]!,
        from connection: AVCaptureConnection!) {
        // get detected meta data
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;didOutputMetaDataObjects&lt;/code&gt; delegate method will give us detected meta data objects from our connection.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let metadataObj = metadataObjects\[0\] as! AVMetadataMachineReadableCodeObject
if metadataObj.type == AVMetadataObjectTypeQRCode {
   if metadataObj.stringValue != nil {
      debugPrint(metadataObj.stringValue)
   }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, we are casting our meta data object to &lt;code&gt;AVMetaDataMeachineReadableCodeObject&lt;/code&gt; first and checking whether it is type of QR code or not. stringValue from meta data object is our decoded QR code message.&lt;/p&gt;
&lt;p&gt;Meta data object does provide the detected QR code frames. So we can show the detected frames in our camera preview as well. To get the frames use &lt;code&gt;transformedMetaDataObject&lt;/code&gt; method from AVVideoPreviewLayer class.&lt;/p&gt;
&lt;p&gt;let barCodeObject = videoPreviewLayer?.transformedMetadataObject(for: metadataObj)&lt;/p&gt;
&lt;p&gt;barCodeObject.bounds will give us the frames of detected code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you want to detect the Face on camera view, we can follow the same method as QR code and add face type for metadataobjects. Check out m Github repo branch for more info.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rizwankce/Camera/tree/feature/detect-face&quot;&gt;rizwankce/Camera
&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;iOS 11 has new Vision API’s to detect QR codes as well. &lt;em&gt;Documentation is not mature enough yet. Still trying to figure out how to read QR with Vision API&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Example project on Github has more functions like display the detected QR code in a UILabel and draw a square on camera preview by using detected meta data bounds.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Though Swift Camera series ends here. I will write tiny post in future for sure. So follow me on here or &lt;a href=&quot;https://twitter.com/rizzu26&quot;&gt;twitter&lt;/a&gt; to get updates. I would like to thank &lt;a href=&quot;https://medium.com/compileswift&quot;&gt;ComplieSwift&lt;/a&gt; editor and everyone who recommended and followed me on medium.&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded></item><item><title>SwiftUI Color Scheme</title><link>https://rizwan.dev/blog/swiftui-color-scheme/</link><guid isPermaLink="true">https://rizwan.dev/blog/swiftui-color-scheme/</guid><description>SwiftUI way to change the interface style</description><pubDate>Wed, 22 Jul 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In UIKit app, If you would like to change the color scheme within the app. Setting &lt;code&gt;UserInterfaceStyle&lt;/code&gt; object to your root window would help.&lt;/p&gt;
&lt;p&gt;Take a look at &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire&quot;&gt;NetNewsWire&lt;/a&gt; iOS app. It gives Appearance settings where you can choose your color palette for the app. These are the possible options&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automatic: respects system color scheme and changes whenever user switching between light and dark mode from the OS&lt;/li&gt;
&lt;li&gt;Light: Light mode for the whole app and didn&apos;t respect the system color scheme&lt;/li&gt;
&lt;li&gt;Dark: dark mode for the whole app and didn&apos;t respect the system color scheme&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;func updateUserInterfaceStyle() {
  switch AppDefaults.userInterfaceColorPalette {
    case .automatic:
      window!.overrideUserInterfaceStyle = .unspecified
    case .light:
      window!.overrideUserInterfaceStyle = .light
    case .dark:
      window!.overrideUserInterfaceStyle = .dark
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Setting &lt;code&gt;unspecified&lt;/code&gt; makes the app respects the system-wide color scheme here.&lt;/p&gt;
&lt;h2&gt;SwiftUI Way&lt;/h2&gt;
&lt;p&gt;SwiftUI gives us an environment variable and preferred color scheme modifier to change the color scheme.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;struct ContentView: View {
    @State var preferredColorScheme: ColorScheme? = nil

    var body: some View {
        List {
		        Button(action: {
                preferredColorScheme = .light
            }) {
                HStack {
                    Text(&quot;Light&quot;)
                    Spacer()
                    if preferredColorScheme == .light {
                        selectedImage
                    }
                }
            }

            Button(action: {
                preferredColorScheme = .dark
            }) {
                HStack {
                    Text(&quot;Dark&quot;)
                    Spacer()
                    if preferredColorScheme == .dark {
                        selectedImage
                    }
                }
            }
        }
        .listStyle(InsetGroupedListStyle())
        .preferredColorScheme(preferredColorScheme)
        .navigationBarTitle(&quot;ColorScheme Test&quot;)
    }

    var selectedImage: some View {
        Image(systemName: &quot;checkmark&quot;)
            .foregroundColor(.blue)
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are setting the &lt;code&gt;preferredColorScheme&lt;/code&gt; modifier to our content view and changing it via &lt;code&gt;@State&lt;/code&gt; object. It will give us one view with two options where you can change the color scheme.&lt;/p&gt;
&lt;p&gt;It&apos;s also possible with the environment value like below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@main
struct ColorSchemeTestApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(\.colorScheme, .dark)
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also get to know the currently selected color scheme via environment object like below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@Environment(\.colorScheme) var colorScheme
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As of beta 2, there is no way that I can find, to set the &lt;code&gt;colorScheme&lt;/code&gt; to &lt;code&gt;unspecified&lt;/code&gt; to get automatic behaviour. I have even filed a Feedback. In case if you find a way to achieve it, let me know at &lt;a href=&quot;https://www.twitter.com/rizzu26&quot;&gt;twitter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I did create a sample project to explain the behaviour and you can find it &lt;a href=&quot;https://github.com/rizwankce/SwiftUIColorSchemeTest&quot;&gt;here&lt;/a&gt; at Github.&lt;/p&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/documentation/swiftui/environmentvalues/colorscheme&quot;&gt;Color Scheme&lt;/a&gt; Apple documentation&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/documentation/swiftui/disclosuregroup/preferredcolorscheme(_:)&quot;&gt;Preferred Color Scheme&lt;/a&gt; modifier Apple documenation&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire&quot;&gt;NetNewsWire&lt;/a&gt; project on Github&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>SwiftUI Import/Export files</title><link>https://rizwan.dev/blog/swiftui-import-export-files/</link><guid isPermaLink="true">https://rizwan.dev/blog/swiftui-import-export-files/</guid><description>SwiftUI way to present document picker</description><pubDate>Sat, 18 Jul 2020 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Future Me: Things have changes with Xcode beta and this post is outdated. Please take a look at part 2 of this blog &lt;a href=&quot;https://blog.rizwan.dev/blog/swiftui-import-export-files-part-2&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As discussed on my previous blog &lt;a href=&quot;https://blog.rizwan.dev/blog/learning-swiftui-with-netnewswire&quot;&gt;post&lt;/a&gt;, kickstarting my learnings from contributing to SwiftUI open source project.
In this blog post, I try to explain what I have come across very recently which was missed out during WWDC and impressed when I came to know about it. It&apos;s about import and exporting files.&lt;/p&gt;
&lt;p&gt;In traditional UIKit, whenever you want to export or import files. We have to rely on &lt;code&gt;UIDocumentPickerViewController&lt;/code&gt;.
Here is the sample code from &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire&quot;&gt;NetNewsWire&lt;/a&gt; iOS app where we try to export and import OPML files.&lt;/p&gt;
&lt;h3&gt;Importing files&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;let docPicker = UIDocumentPickerViewController(documentTypes: opmlUTIs, in: .import)
docPicker.delegate = self
docPicker.modalPresentationStyle = .formSheet
self.present(docPicker, animated: true)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above code will present a document picker and user can select any OPML files from the Files app.&lt;/p&gt;
&lt;h3&gt;Exporting files&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;let docPicker = UIDocumentPickerViewController(url: tempFile, in: .exportToService)
docPicker.modalPresentationStyle = .formSheet
self.present(docPicker, animated: true)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above code will present a document picker and user can export the OPML files to the Files app.&lt;/p&gt;
&lt;h1&gt;SwiftUI way&lt;/h1&gt;
&lt;p&gt;We saw what it takes to import and export files in UIKit. But in SwiftUI all it takes is one environment object.By utilising the all new export and import files environment values we could easily add support to our SwiftUI apps for import/export functions.&lt;/p&gt;
&lt;h3&gt;Step 1&lt;/h3&gt;
&lt;p&gt;At first, define the environment object on your &lt;code&gt;View&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@Environment(\.exportFiles) var exportAction
@Environment(\.importFiles) var importAction
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Step 2&lt;/h3&gt;
&lt;p&gt;Use the environment variable to export or import files. As like UIKit importing action needs file types and exporting action needs the temporary file urls.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// consider you have file temporary url
exportAction(moving: url) { _ in }
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;importAction(multipleOfType: types) { (result: Result&amp;lt;[URL], Error&amp;gt;?) in
	if let urls = try? result?.get() {
		// you can do with the file urls here
	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s also possible to import/export multiple files.&lt;/p&gt;
&lt;p&gt;Check out more on my &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire/pull/2204/files&quot;&gt;PR on Github&lt;/a&gt; for how it works on NetNewsWire app.&lt;/p&gt;
&lt;h1&gt;UniformTypeIdenfiers&lt;/h1&gt;
&lt;p&gt;SwiftUI also comes with a new framework for all &lt;code&gt;UTTypes&lt;/code&gt; and it&apos;s called &lt;code&gt;UniformTypeIdentifiers&lt;/code&gt;. This also helps us to define what kind of files we can choose from. It comes with predefined files types and you can find all the system declared types &lt;a href=&quot;https://developer.apple.com/documentation/uniformtypeidentifiers/uttype/system_declared_types&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For any specific case, we can also create our own &lt;code&gt;UTType&lt;/code&gt; with file extensions as well. Here is the code to select only OPML files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let type = UTType(filenameExtension: &quot;opml&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;p&gt;Check out more info on Apple documentation&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/documentation/swiftui/importfilesaction&quot;&gt;Import files action&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/documentation/swiftui/exportfilesaction&quot;&gt;Export files action&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/documentation/uniformtypeidentifiers&quot;&gt;UniformTypeIdentifiers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>SwiftUI Import/Export files - Part 2</title><link>https://rizwan.dev/blog/swiftui-import-export-files-part-2/</link><guid isPermaLink="true">https://rizwan.dev/blog/swiftui-import-export-files-part-2/</guid><description>SwiftUI way to present document picker</description><pubDate>Wed, 07 Oct 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;There were lots of changes this year during the Xcode and iOS beta. Typically we will get major new features on initial beta
and subsequent beta will have only bug fixes. This year is a little bit different, we even got changes to Swift UI at the end of the beta cycle.&lt;/p&gt;
&lt;p&gt;Beta 6 made a change for SwiftUI import/export files. Instead of environment variable now its a modifier. My &lt;a href=&quot;https://blog.rizwan.dev/blog/swiftui-import-export-files&quot;&gt;previous&lt;/a&gt; blog post is outdated and now that Xcode 12 is out, I guess these needs follow up post.&lt;/p&gt;
&lt;h2&gt;Importing&lt;/h2&gt;
&lt;p&gt;To import file, we have to use the &lt;code&gt;fileImporter&lt;/code&gt; modifier. There is no limit where you have to use this modifier. It&apos;s working same as presenting sheets before.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.fileImporter(
      isPresented: $viewModel.isImporting,
      allowedContentTypes: viewModel.importingContentTypes,
      allowsMultipleSelection: true,
      onCompletion: { result in
        if let urls = try? result.get() {
          // you can do with the file urls here
        }
      }
    )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The parameters were self-explainable. It takes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a &lt;code&gt;Binding&amp;lt;Bool&amp;gt;&lt;/code&gt; for presented statues&lt;/li&gt;
&lt;li&gt;an array of content types &lt;code&gt;[UTType]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;a bool to allow multiple selections while importing&lt;/li&gt;
&lt;li&gt;a completion block when the import is success&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Exporting&lt;/h2&gt;
&lt;p&gt;To export files, we have to use the &lt;code&gt;fileMover&lt;/code&gt; modifier.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.fileMover(isPresented: $viewModel.isExporting,
           file: viewModel.generateExportURL()) { _ in }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;File mover takes a &lt;code&gt;Binding&amp;lt;Bool&amp;gt;&lt;/code&gt; for presented status and the URL of the file which needs to be exported.&lt;/p&gt;
&lt;p&gt;In case, if you would like to know a working example, take a look at &lt;a href=&quot;https://github.com/Ranchero-Software/NetNewsWire/pull/2384/files&quot;&gt;this&lt;/a&gt; PR I have raised for NetNewsWire app.&lt;/p&gt;
</content:encoded></item><item><title>TestFlight Review Times</title><link>https://rizwan.dev/blog/test-flight-review-times/</link><guid isPermaLink="true">https://rizwan.dev/blog/test-flight-review-times/</guid><description>TestFlight review times and workflow improvments</description><pubDate>Wed, 03 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you ever submitted an app update recently to TestFlight review on App Store Connect, you know the time take to get it approved. It was the case for even App Store app updates some time back. Recently Apple is improving the total time taken for review resulting in one day review time (some developers from US time zone can get even less then an hour)&lt;/p&gt;
&lt;p&gt;At my work, we do have multiple beta groups and most of the time a new update would take more then 2 days to get it reviewed for TestFlight. Its doesn&apos;t work for urgent release. So we changed the release process little bit different and always keep the TestFlight app updates near instant.&lt;br /&gt;
&lt;br /&gt;
The way TestFlight update works is every new version update has to go to review and every build on the same version is apporved immediately.&lt;/p&gt;
&lt;p&gt;So whenever we released a version to App Store, immediately we submit the same build again for TestFlight app review by bumping the version number. By the time we finish developing the app update, the initial version submitted to review would be approved and submitting second build on same version would get approved immediately.&lt;/p&gt;
&lt;p&gt;For example, after releasing v5.0 to App Store, try submitting v5.1 (or whatever version on your pipeline) with the same build as v5.0. Only change here is version number. By the time you actually wants to push v5.1 for your beta testers. Just bump the build number and submit. It will be approved immediately.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Above works fine as of dated. Who knows WWDC 2020 might have some improvements.&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded></item><item><title>Tracker Prevention for WKWebView</title><link>https://rizwan.dev/blog/trackers-prevention-for-wkwebview/</link><guid isPermaLink="true">https://rizwan.dev/blog/trackers-prevention-for-wkwebview/</guid><description>Block online trackers in your webview</description><pubDate>Wed, 12 Aug 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In 2017, Apple WebKit team announced &lt;a href=&quot;https://webkit.org/tracking-prevention/&quot;&gt;&quot;Intelligent Trackers Protection&quot;&lt;/a&gt; feature which blocks cross-site trackers and cookies. Slowly WebKit team is adding new features to WebKit and bringing the same to Safari.&lt;/p&gt;
&lt;h2&gt;Safari 14&lt;/h2&gt;
&lt;p&gt;Safari 14 improves ITP and by default, it will block all the cross-site trackers by using on-device machine learning to identify trackers and the known trackers are identified by DuckDuckGo. Safari not only blocks the trackers, but it will also list all the trackers and websites in detail. Here is the screenshot of all trackers blocked from Safari 14. I have been using it from beta 1.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;WKWebView&lt;/h2&gt;
&lt;p&gt;The interesting thing with ITP is we (third party developers) can start using it for our in-app browsers which uses &lt;code&gt;WKWebView&lt;/code&gt; without any extra effort. It comes free when you use &lt;code&gt;WKWebView&lt;/code&gt; and you have iOS 14 or macOS Big Sur installed.&lt;/p&gt;
&lt;p&gt;In case if we want to opt-out from this default behaviour, we could simply set the purpose string &lt;code&gt;NSCrossWebsiteTrackingUsageDescription&lt;/code&gt; in &lt;code&gt;Info.plist&lt;/code&gt;. When present, this key causes the application’s Settings screen to display a user control to disable ITP. The setting cannot be read or changed through API calls.&lt;/p&gt;
&lt;p&gt;NOTE: As of beta 4, I couldn&apos;t get the settings even after adding purpose string. Probably it will work on upcoming beta&apos;s&lt;/p&gt;
&lt;p&gt;Incase if the app wants to be &lt;a href=&quot;https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content/preparing_your_app_to_be_the_default_browser_or_email_client&quot;&gt;&quot;Default Browser&quot;&lt;/a&gt;, purpose strings is not necessary.&lt;/p&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;WebKit App Bound domains &lt;a href=&quot;https://webkit.org/blog/10882/app-bound-domains/&quot;&gt;blog post&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Special thanks to &lt;a href=&quot;https://twitter.com/stuarticus&quot;&gt;Stuart&lt;/a&gt; who introduced to me this feature in NetNewsWire Slack channel when we discussed having tracker protection for app.&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded></item><item><title>Uses</title><link>https://rizwan.dev/blog/uses/</link><guid isPermaLink="true">https://rizwan.dev/blog/uses/</guid><description>Software and Hardware I use</description><pubDate>Thu, 07 May 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Inspired from wesbos’s &lt;a href=&quot;https://wesbos.com/uses&quot;&gt;&lt;code&gt;/uses&lt;/code&gt;&lt;/a&gt; trying to gather all the things I use.&lt;/p&gt;
&lt;h3&gt;Hardware &amp;amp; Accessories&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;MacBook Pro 15 inch - 2016 - i7, 16 GB RAM, 512 GB SSD, Radeon Pro 455 2 GB Graphics&lt;/li&gt;
&lt;li&gt;1st gen Magic keyboard / Keychron k2&lt;/li&gt;
&lt;li&gt;Logitech MX Master 3&lt;/li&gt;
&lt;li&gt;iPhone 11 Pro&lt;/li&gt;
&lt;li&gt;Roost laptop stand&lt;/li&gt;
&lt;li&gt;Bose QC II / AirPods 1st gen&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Software&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Xcode - ٩(◕‿◕｡)۶&lt;/li&gt;
&lt;li&gt;App code - for good old Objective-C&lt;/li&gt;
&lt;li&gt;VS Code - for everything else&lt;/li&gt;
&lt;li&gt;Nova from Panic - beta testing and mainly for React and React Native&lt;/li&gt;
&lt;li&gt;Paw / Postman - for all my HTTP test&lt;/li&gt;
&lt;li&gt;Sip - color picker - to pick color from anywhere on the screen&lt;/li&gt;
&lt;li&gt;1Password - weapon of choice for password manager&lt;/li&gt;
&lt;li&gt;NetNewsWire - RSS reader&lt;/li&gt;
&lt;li&gt;Source Tree - Git&lt;/li&gt;
&lt;li&gt;Things 3 - Goto task manager&lt;/li&gt;
&lt;li&gt;iTerm2 - Terminal of choice with zsh&lt;/li&gt;
&lt;li&gt;Contraste - Color picker and a11y checker&lt;/li&gt;
&lt;li&gt;Dev Cleaner - to clear everything from Xcode&lt;/li&gt;
&lt;li&gt;Hidden Bar - to hide menu bar icons&lt;/li&gt;
&lt;li&gt;One Switch&lt;/li&gt;
&lt;li&gt;Pastebot - clipboard manager&lt;/li&gt;
&lt;li&gt;Tot - stickies notes but better&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Others&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Font of choice - Dank Mono&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=wesbos.theme-cobalt2&quot;&gt;Cobalt 2 theme&lt;/a&gt; on VS Code and custom &lt;a href=&quot;https://github.com/rnystrom/Metro-Lights&quot;&gt;Metro lights theme&lt;/a&gt; for Xcode&lt;/li&gt;
&lt;li&gt;Backups are in iCloud - having 50GB tier&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rizwankce/dotfiles&quot;&gt;Dotfiles&lt;/a&gt; are in GitHub&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>When Not to Delegate to LLMs</title><link>https://rizwan.dev/blog/when-not-to-delegate-to-llms/</link><guid isPermaLink="true">https://rizwan.dev/blog/when-not-to-delegate-to-llms/</guid><description>Understanding the limits of LLM coding tools and knowing when manual work is actually faster</description><pubDate>Mon, 20 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;We&apos;re living in the age of LLMs and coding agents - tools like Claude Code, GitHub Copilot, and various CLI assistants promise to accelerate our development workflow. And they do, most of the time. But there&apos;s a catch: not every task is a good fit for delegation to these tools.&lt;/p&gt;
&lt;h2&gt;The Storyboard Refactoring Story&lt;/h2&gt;
&lt;p&gt;Recently, I needed to refactor some Storyboard files in an iOS app. (Yes! Im stuck with work app on Storyboard files) Since Storyboards are XML-based, I thought this would be a perfect task for Claude Code or similar tools. Text manipulation is what LLMs excel at, right?&lt;/p&gt;
&lt;p&gt;Turns out, I was wrong.&lt;/p&gt;
&lt;p&gt;The problem wasn&apos;t the XML itself - it was everything around it. Xcode project files have their own special format. They maintain complex references between files, build configurations, and project settings. Interface Builder has specific constraints about how UI elements can be structured. Breaking any of these invisible rules means your project either won&apos;t build or will crash at runtime with cryptic errors.&lt;/p&gt;
&lt;p&gt;I spent more time debugging the LLM&apos;s output, fixing broken references, and troubleshooting build errors than I would have spent doing the refactoring myself. When I finally gave up and did it manually, it took about 5 minutes.&lt;/p&gt;
&lt;h2&gt;When LLMs Struggle&lt;/h2&gt;
&lt;p&gt;Three patterns trip them up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tight file formats&lt;/strong&gt;: Xcode projects, Storyboards, and other bespoke files crash if a single reference goes missing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Toolchain nuance&lt;/strong&gt;: An LLM hasn&apos;t spent years with Xcode, Gradle, or your CI, so it misses the small switches that keep things running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tiny chores&lt;/strong&gt;: If you can do it in minutes, the prompt-review-fix loop is slower than typing it yourself.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The Real Skill&lt;/h2&gt;
&lt;p&gt;Before delegating, run through a fast checklist:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Does this rely on niche tooling or hidden rules?&lt;/li&gt;
&lt;li&gt;Can I finish it in under 10 minutes solo?&lt;/li&gt;
&lt;li&gt;Will I spend more time vetting the output than producing it?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Any yes means I stay hands-on.&lt;/p&gt;
</content:encoded></item><item><title>WWDC 2020 Wish-list</title><link>https://rizwan.dev/blog/wwdc-2020-wish-list/</link><guid isPermaLink="true">https://rizwan.dev/blog/wwdc-2020-wish-list/</guid><description>My top wish-list for this year WWDC</description><pubDate>Fri, 22 May 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I wrote my thoughts on WWDC 2020 wish-list on twitter. Here is the list not in any particular order but hope to see it in real.&lt;/p&gt;
&lt;p&gt;Also, did I tell you? This will be my first ever WWDC. Since It&apos;s online and free for everyone.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258537074556194818?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258537074556194818?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258537254894485504?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258537254894485504?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258537413271416832?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258537413271416832?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258537588513619968?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258537588513619968?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258538534295621633?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258538534295621633?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1258538768350375937?s=20&quot;&gt;https://twitter.com/rizzu26/status/1258538768350375937?s=20&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/rizzu26/status/1259826268444307456?s=20&quot;&gt;https://twitter.com/rizzu26/status/1259826268444307456?s=20&lt;/a&gt;&lt;/p&gt;
</content:encoded></item></channel></rss>