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.
- What does the App Sandbox actually change in a running Mac process, and how do you test it without a paid account?
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… - What do the Hardened Runtime flag and its exception entitlements change, and what can you inspect about a signature without a Developer ID?
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.
- What is the difference between a stored path and a bookmark, and how do security-scoped bookmarks work in a sandboxed Mac app?
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… - How does a menu item find its target on the responder chain, what do key equivalents do, and what happens for a disabled item?
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.
- What does a Mac Catalyst build compile against, and how do you add Mac menus and keep AppKit out?
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
- 20.1 · Shared cores, platform conditions, capabilities, and the release train
- 20.2 · Documents, scenes and windows on iPad
- 20.3 · Catalyst, native AppKit and SwiftUI on the Mac, and the Mac’s sandbox and menus
- 20.4 · The focus engine, the remote and the 10-foot UI, and media-first apps
- 20.5 · Input and battery, on-watch health and networking, and the dual-target setup
- 20.6 · Windows, volumes and immersive spaces
- 20.7 · What the compiler and the runtime say about each platform
- 20.9 · Which scenes, modifiers and spaces exist where, and how a package declares them