20.8 · The Mac sandbox, signing, bookmarks, menus and Catalyst, measured

Run the Mac-specific rules rather than recite them: what the sandbox denies, what Hardened Runtime blocks, what a bookmark survives, and what a menu does with a disabled item.

Mental model. On the Mac the platform checks you, so run a signed build to learn what is allowed.

Sandbox and signing

What an entitlement and a signing flag change in a running process.

  1. What does the App Sandbox actually change in a running Mac process, and how do you test it without a paid account? 20.8.1 · L3
    Compile one small program and run it twice. Unsandboxed, it sees the real home directory, can write to /Users/Shared, and can read /etc/hosts. After signing…
  2. What do the Hardened Runtime flag and its exception entitlements change, and what can you inspect about a signature without a Developer ID? 20.8.2 · L3
    Signing with -o runtime sets the Hardened Runtime flag, which codesign -dvv shows as flags=0x10002(adhoc,runtime) (0x2 is “adhoc”, 0x10000 is “runtime”). With…

Files and commands

Bookmarks that outlive paths, and key equivalents on the responder chain.

  1. What is the difference between a stored path and a bookmark, and how do security-scoped bookmarks work in a sandboxed Mac app? 20.8.3 · L3
    A path is a string that names a place and breaks when the file moves. A bookmark (URL.bookmarkData()) is an opaque blob that records the file’s identity, so it…
  2. How does a menu item find its target on the responder chain, what do key equivalents do, and what happens for a disabled item? 20.8.4 · L3
    An NSMenuItem has an action selector and an optional target. With a nil target (the usual case for Quit, Save, Copy) AppKit walks the responder chain from the…

Catalyst

The macabi slice, UIMenuBuilder and the limits of the AppKit import.

  1. What does a Mac Catalyst build compile against, and how do you add Mac menus and keep AppKit out? 20.8.5 · L3
    The Catalyst slice is arm64-apple-ios17.0-macabi: iOS source built against the macOS SDK’s iOSSupport frameworks. UIKit is present and the conditions are…

More in Multiplatform Apple