<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Macos on Nick Liu - Software Engineer</title>
    <link>/tags/macos/</link>
    <description>Recent content in Macos on Nick Liu - Software Engineer</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>nickboy@users.noreply.github.com (Nick Liu)</managingEditor>
    <webMaster>nickboy@users.noreply.github.com (Nick Liu)</webMaster>
    <copyright>2026 Nick Liu</copyright>
    <lastBuildDate>Sun, 10 May 2026 22:48:37 -0700</lastBuildDate><atom:link href="/tags/macos/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>launchctl unload returned 0. The daemon was still running. KeepAlive raced.</title>
      <link>/posts/launchd-bootstrap-debugging/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <author>nickboy@users.noreply.github.com (Nick Liu)</author>
      <guid>/posts/launchd-bootstrap-debugging/</guid>
      <description>&lt;div class=&#34;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&#34;&gt;&#xA;  &#xA;`launchctl unload ~/Library/LaunchAgents/com.nickboy.claudedeck.plist` exited 0. Then `pgrep -f claudedeck-daemon` printed a fresh PID. Three seconds after the &#34;unload succeeded&#34; line. Spoiler: KeepAlive is a polling supervisor, not an event-driven one, and when you tell launchd to tear a job down, there is a window where the supervisor has already noticed the previous PID is gone and started a replacement.&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;(One-paragraph grounding if launchd isn&amp;rsquo;t your daily driver: &lt;em&gt;launchd&lt;/em&gt; is macOS&amp;rsquo;s init system — the equivalent of &lt;code&gt;systemd&lt;/code&gt; on Linux or Windows Services on Windows. It boots PID 1, brings up daemons, restarts them when they crash. A &lt;em&gt;LaunchAgent&lt;/em&gt; is a per-user launchd job, defined by an XML &lt;em&gt;plist&lt;/em&gt; — property list — at &lt;code&gt;~/Library/LaunchAgents/&amp;lt;name&amp;gt;.plist&lt;/code&gt;. &lt;em&gt;KeepAlive&lt;/em&gt; is one of the plist keys; set it to &lt;code&gt;true&lt;/code&gt; and launchd will respawn the job whenever it exits. &lt;em&gt;&lt;code&gt;launchctl&lt;/code&gt;&lt;/em&gt; is the CLI you use to load, unload, and inspect those jobs. The Linux mental model: think &lt;code&gt;systemctl&lt;/code&gt; driving &lt;code&gt;systemd&lt;/code&gt; unit files. The Stream Deck plugin and its daemon are described in &lt;a href=&#34;/posts/tcc-cdhash-trap/&#34; &gt;the TCC cdhash trap post&lt;/a&gt; if you want the project context.)&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>TCC pins your Accessibility grant to a cdhash. Every rebuild breaks it.</title>
      <link>/posts/tcc-cdhash-trap/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <author>nickboy@users.noreply.github.com (Nick Liu)</author>
      <guid>/posts/tcc-cdhash-trap/</guid>
      <description>&lt;div class=&#34;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&#34;&gt;&#xA;  &#xA;My daemon&#39;s preflight log said `osascript is not allowed assistive access. (-1719)`. System Settings disagreed — the entry was right there, toggled on. Spoiler: ad-hoc codesigning pins TCC&#39;s designated requirement to the binary&#39;s cdhash, and `bun build --compile` produces a different cdhash on every rebuild.&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;I&amp;rsquo;m building a Stream Deck plugin called &lt;a href=&#34;https://github.com/nickboy/claudedeck&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ClaudeDeck&lt;/a&gt; — Stream Deck is Elgato&amp;rsquo;s little USB grid of programmable keys with LCD displays under each one. The plugin talks to a background daemon (a long-running process that starts at login and waits for events), and that daemon needs to call System Events via AppleScript to switch Ghostty tabs (Ghostty is my terminal emulator) whenever I press a Stream Deck key. macOS gates that capability — automating other apps — through &lt;strong&gt;System Settings → Privacy &amp;amp; Security → Accessibility&lt;/strong&gt;, the pane you&amp;rsquo;ve probably toggled for tools like Rectangle or BetterTouchTool. So on first install I added the daemon, toggled it on, and got back to work.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>What replaced CGEventPost in my Stream Deck daemon</title>
      <link>/posts/tahoe-hotkey-dead-end/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <author>nickboy@users.noreply.github.com (Nick Liu)</author>
      <guid>/posts/tahoe-hotkey-dead-end/</guid>
      <description>&lt;div class=&#34;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&#34;&gt;&#xA;  &#xA;I press the Stream Deck key. The daemon logs the press, synthesizes `Cmd+Opt+;` through CoreGraphics, and exits cleanly. Wispr Flow does nothing. Three Apple subsystems and one decompiled Electron bundle later, the working trigger turned out to be a one-line URL.&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;The plan was the boring kind: Stream Deck key (the physical button on Elgato&amp;rsquo;s programmable USB grid) → WebSocket message → my daemon (long-running background process) → synthesized global hotkey → Wispr Flow&amp;rsquo;s hands-free dictation starts — Wispr Flow is the voice-to-text Mac app that types your speech into the focused window — → I talk → words show up in my editor. I&amp;rsquo;d done variants of this with &lt;code&gt;osascript&lt;/code&gt; (macOS&amp;rsquo;s command-line AppleScript runner) years ago. Should have taken an afternoon.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
