"Ask who owns a window before you count it."
An App Without a Dock Icon
Most of the family's utilities live in the menu bar: a text transformer, a dictation tool, launchers for the voice and quest engines. They share one shape. LSUIElement = true in Info.plist (or setActivationPolicy(.accessory) in code, which does the same after launch) keeps the app out of the Dock and the app switcher and gives it no main menu. An NSStatusItem from NSStatusBar.system is its whole visible surface, with a template image so the icon follows light, dark and tinted menu bars, and an NSMenu that opens from it.
Two details come with that shape. An accessory app is not the active app just because its window exists, so a Settings window opened from the menu can appear behind whatever was frontmost. Order the window front and call NSApp.activate(), available since macOS 14. That activation is cooperative, so macOS can decline it while someone is working in another app. The AppKit header marks the older activate(ignoringOtherApps:) for deprecation and names this call as its replacement. And keep one NSMenu for the app's lifetime, repopulating its items in place: assigning a fresh menu to item.menu from menuWillOpen leaves the menu that is already tracking stale.
Running, Healthy, and Invisible
The voice launcher ran perfectly on a notched MacBook. launchd showed it running, its log was clean, it reached its engine. There was no icon. An external probe with CGWindowListCopyWindowInfo found zero status-item windows for its pid, which pointed at "the item was never created" and sent the investigation through launch paths and construction timing. Every one of those was eliminated by experiment. Three facts were stacked instead:
- On macOS 26, a status item's window belongs to Control Center, not to the app. The probe filtered on the app's pid, so it could not have found the item. Its zero was a property of the filter. Measured on macOS 26.6, Control Center's layer-25 windows carry each item's bundle identifier as the window name, with a frame.
- A menu-bar manager was running, and it adopts new items into its hidden section, parked far offscreen.
- With the manager quit, the items it had stranded still pushed the layout, and macOS placed the new item under the notch.
isVisiblewas true, and the frame sat in the middle of a 1728-point-wide display, exactly where no pixel exists.
The diagnostic ladder that finally worked: process and launchd state, then the external window probe, then the app's saved NSStatusItem Visible preference, then a bare ten-line status-item test app, then the app printing its own item's frame. Only the last rung, as the rungs were run, could see the answer.
Make the Invisible Case Greppable
The fix that stayed was not a code change to the icon. It was one log line at birth: two seconds after creating the item, the app prints isVisible and the frame of the item's own window. "Running but no icon" is now a grep, and the frame tells you whether to look under the notch, in a menu-bar manager, or at a user who hid the item.