macOS 27发行说明:弃用、破坏性变更与修复
macOS 27 Golden Gate于2026年9月14日(周一)以版本号26A428正式发布,同一天,它的SDK(版本号26A425)随Xcode 27(27A266a)一同推出。 Apple为它撰写的发行说明涵盖86个带标题的领域、272个条目:68项新功能、173项已解决问题、18项已知问题和13项弃用。本文从Mac开发者的角度解读这些条目:应用一旦链接27 SDK就会改变行为的条目、无需重新构建就会生效的系统级变更、对照SDK自身头文件和Swift接口核查过的13项弃用,以及我在一台仍运行26.6.2的Mac上能验证和不能验证的内容。Rosetta和arm64安装器默认值已在Golden Gate GA一文中讨论,本文负责其余的一切。123
TL;DR
- 版本号。 设备26A428,SDK 26A425;SDK的编号并不是设备的编号,当错误报告要求你提供版本号时,这一点很关键。截至9月26日,Apple的发行说明索引和Releases信息源中都没有macOS 27.0.1;最新的条目是27,以及9月21日的27.2 beta 2(26B5091g)。137
- 链接到27后的行为。 13项变更会在应用链接27 SDK的那一刻改变其行为:非符号菜单项图片被隐藏,纯图片菜单项失去例外待遇;
NSOpenPanel根据内容类型推导canChooseFiles;Layout Orientation菜单项移到Font之下;标题栏附件在边界之外绘制;TextField的提示文字接受样式;可选择的Text支持TextRenderer;sheet和popover内的控件修饰符被重置;containerRelativeFrame的安全区域计算;LabeledContent成为菜单副标题;检查器中的TabView切换为tabs样式;List接受过去拒绝的拖放;newDocument接受内存中的文档;以及Mac Catalyst的场景生命周期强制要求和扩展的状态恢复。2 - 无需重新构建。 对于在macOS 26.0或更高版本上链接的任何应用,菜单项符号图片都会消失,SwiftUI和UIKit菜单中甚至完全没有SDK条件;手势识别器变为仅由第一个命中测试的视图层级独占,卡住的手势会自行取消,基类的
locationInView:返回NSZeroPoint;说明列出launchd不再加载带隔离属性的属性列表;直接访问TCC数据库的做法终结;跨团队的容器访问会在不弹出提示的情况下被拒绝;XProtect可以隔离应用数据;MDM和软件更新流量需要TLS 1.2及符合ATS标准的密码套件;用户设为“Open using Rosetta”的应用将以原生方式启动。2 - 13项弃用,其中4项是API。
PHAssetResource.originalFilename只在部署目标为27.0时才发出警告(头文件中为macos(10.15, 27));FileDocument带有软性的100000.0版本,从不警告;calendar.deleteEvents已从App Intents接口中消失,因此旧名称无法编译;DVDPlayback与说明的描述相反,仍以存根、头文件和模块的形式留在27.0 SDK中,在低于27.0的最低版本下发出警告,在27.0下则失败。其余9项不是API,而是系统行为、应用、格式或beta遗留。23 - SDK证实了新的AppKit。
NSRefreshController、NSTextSelectionManager、带有NSToolbarItemGroup.Role和NSSegmentedControlRole的role属性、preferredImageVisibility、cancellableByScrollGesture,以及NSApplicationPresentationDisableScreenCornerInteractions选项,全都标注为macos(27.0);DiskImageKit和NowPlaying框架均已存在;System有了Stat类型;StoreKit有assigned和BundledSubscription,而说明写作assignmentRevoked的地方,接口里写的是assignmentRevocation。3
哪个版本号对应哪里?
| 位置 | 版本号 | 依据 |
|---|---|---|
| 设备,macOS 27.0 | 26A428 | Releases信息源,2026年9月14日(周一)1 |
| Xcode 27(27A266a)内的SDK | 26A425 | MacOSX27.0.sdk/System/Library/CoreServices/SystemVersion.plist,ProductBuildVersion3 |
| macOS 27.2 beta 2 | 26B5091g | Releases信息源,2026年9月21日(周一)1 |
| macOS 27.0.1 | 无 | 截至9月26日,既不在Releases信息源中,也不在macOS发行说明索引中17 |
| App Store Connect | 接受27.0 GA SDK | “You can now upload apps built with Xcode 27 using the SDK for iOS 27.0, iPadOS 27.0, macOS 27.0, tvOS 27.0, visionOS 27.0, and watchOS 27.0 for the App Store, and for internal and external testing through TestFlight.”(现在可以上传用Xcode 27及各27.0 SDK构建的应用,用于App Store以及TestFlight内部和外部测试)9月14日6 |
说明以两句界定范围的话开头,“The macOS 27 SDK provides support to develop apps for Mac computers running macOS 27 Golden Gate. The SDK comes bundled with Xcode 27, available from the Mac App Store,”随后逐一列出86个带标题的领域。统计每个标题下的列表项,得到68项新功能、173项已解决问题、18项已知问题和13项弃用。其中Siri占26项已解决和6项已知,SwiftUI占21项新功能和19项已解决,AppKit占8项新功能和18项已解决,Core AI占11项已解决,StoreKit Testing in Xcode占10项已解决和2项已知。2 iPhone这一侧由iOS 27发行说明一文负责,同样的SwiftUI条目以iOS的措辞出现在那里;工具链则见Xcode 27一文。
9月21日的27.2 beta 2说明很短:一项被列为已修复的Xcode代码补全崩溃,一项AppKit弃用(”The EnablePasteboardPrivacyDeveloperPreview user default has been removed.”,即该用户默认值已被移除),一项全新安装时的Notifications已知问题,一项Shortcuts已知问题,下文两项StoreKit Testing已知问题转为已修复,外加一项新的StoreKit Testing修复,涉及SKTestSession.clearTransactions()之后的推介促销优惠资格。除了这些StoreKit Testing条目,其中没有任何内容触及本文讨论的27.0条目。4
链接macOS 27 SDK的那一刻会改变什么?
Apple按应用所链接的SDK来启用行为变更,因此下面这些变更对你已经发布的构建毫无影响,而会在你从Xcode 27第一次归档时全部触发。逐条引用说明原文:2
- 非符号菜单项图片,以及空标题的例外。 下文的符号图片变更无需重新构建;其余部分由重新构建带来。“For applications linked on the macOS 27 SDK, both symbol and non-symbol menu item images are now automatically hidden. For applications linked on earlier SDKs, non-symbol images remain automatically visible, preserving compatibility with existing application behavior.”(链接27 SDK的应用中,符号和非符号菜单项图片都会被自动隐藏;链接更早SDK的应用中,非符号图片仍然可见)而对旧构建则是反方向的处理:“For applications linked on SDKs prior to macOS 27, NSMenu now automatically shows menu item images if the menu item title and attributed title are both empty. This preserves existing application behavior when the image is the only representation of the menu item content. When linking against the macOS 27 SDK, these images will automatically be hidden.”(链接27之前SDK的应用,若菜单项标题为空,NSMenu会自动显示其图片;链接27 SDK后,这些图片会被自动隐藏)纯图片菜单项在重新构建后需要把
preferredImageVisibility设为.visible。我在菜单图片一文中逐步讲解了排查方法。 - 打开面板自行推导可选对象。 列为已修复:”In apps built with the macOS 27.0 SDK, setting
allowedContentTypesandtreatsFilePackagesAsDirectoriesonNSOpenPaneupdatescanChooseFilesandcanChooseDirectoriesbased on whether the requested types are file or directory types.”(根据所请求的类型是文件还是目录,更新canChooseFiles和canChooseDirectories)(说明把类名拼错了。)设置了内容类型、又依赖显式canChooseDirectories = true的打开面板,正是需要重新测试的形态。 - Layout Orientation挪了位置。 “NSTextView’s
menuForEvent:now returns a context menu in which the Layout Orientation menu item, and its submenu, are located inside the Font submenu. Because this change can cause compatibility issues with some shipping applications, it applies only to applications linked on the macOS 27 SDK.”(Layout Orientation菜单项及其子菜单移入Font子菜单;出于兼容性考虑,只适用于链接27 SDK的应用)通过遍历菜单来查找该菜单项的代码,会在重新构建后失效。 - 标题栏附件越界绘制。 “When an app is linked on macOS 27.0 or later,
NSTitlebarAccessoryViewControlleris now allowed to draw outside its bounds by default, supporting effects such as shadows and interactive glass effects. During reveal animations, accessories might be clipped for the duration of the animation or when the accessory ishidden.”(为了阴影和交互式玻璃效果,默认允许在边界之外绘制;在显示动画期间或附件为hidden时可能被裁剪) TextField的提示文字接受样式。 “In apps built with the macOS 27.0 SDK,TextFieldrespects custom font and color styling applied to its prompt. Apply styling to theTextprovided toTextField’spromptparameter at initialization.”(提示文字上的自定义字体和颜色会生效,应在初始化时为传给prompt参数的Text设置样式)- 可选择的
Text支持TextRenderer。 说明写道”In apps built with the iOS 27.0 and macOS 27.0 SDKs, selectableTextviews now supportTextRenderer,“,旁边的已修复条目则说,自定义渲染器”now takes effect on aTextview that also has.textSelection(.enabled)applied.”(现在对同时应用了.textSelection(.enabled)的Text视图生效) - sheet和popover。 列为已修复:”In apps built with the 27.0 SDKs, the
controlSize,buttonSizing,buttonRepeatBehavior,menuIndicatorVisibility, andButtonBorderShapeenvironment values are now reset to their default values in sheets and popovers.”(这些环境值在sheet和popover中会被重置为默认值)从呈现方继承了.controlSize(.large)的sheet,将不再继承。 containerRelativeFrame。 针对27.0构建列为已修复:该修饰符”incorrectly accounts for safe-area insets on aScrollView’s non-scrollable axis, causing the calculated scrollable content size to be too small.”(在ScrollView不可滚动的轴上错误地计入安全区域内边距,导致算出的可滚动内容尺寸过小)不过条目的示例描述的是内容延伸进安全区域,而不是缩小,因此变化的方向并不明确;重新构建后,请重新测试ScrollView内的每一处containerRelativeFrame。- 菜单有了副标题。 “In apps built with the 27.0 SDKs, a
LabeledContentview used inside aMenumaps its value to the platform menu item’s subtitle.”(Menu中的LabeledContent会把其值映射为平台菜单项的副标题) - 检查器中的
TabView。 “In apps built with the latest SDKs, the appearance ofTabViewsin inspectors now matches their appearance in sidebars, and in both contexts automatically uses the new.tabspicker style.”(检查器中TabView的外观与边栏一致,两处都会自动使用新的.tabs选择器样式) List接受更多拖放。 “In macOS apps built with the macOS 27 SDK,Listaccepts drops in two cases that previously didn’t work: drags with compatible transfer representations are accepted into reorderable content even when the.reorderableItemtransfer type isn’t present, and a.dropDestination(...)modifier declared on a list item now performs the drop.”(带有兼容传输表示的拖动即使没有.reorderableItem也会被可重排内容接受,而声明在列表项上的.dropDestination(...)现在会真正执行拖放)一个在Mac上从未触发过的拖放处理程序,可能会开始触发。newDocument接受实例。 “In macOS apps built with the macOS 27 SDK, the action retrieved from the\.newDocumentenvironment value accepts an in-memoryReadableDocumentproduced by an autoclosure. SwiftUI presents a new document window populated with the supplied instance, instead of invoking the document group’s default factory.”(\.newDocument动作接受由自动闭包生成的内存中ReadableDocument,SwiftUI用该实例打开新文档窗口,而不调用文档组的默认工厂)- Mac Catalyst。 在UIKit的弃用条目中:”Apps built with the latest SDK must adopt the scene-based life cycle or they fail to launch,”,这与场景一文针对iOS讨论的强制要求相同;另有”When linked on iOS 27, tvOS 27, macCatalyst 27, or visionOS 27 SDKs, you can use
UIScene.extendStateRestorationandUIScene.completeStateRestorationto extend state restoration”,可把状态恢复延伸到从后台切换到前台的过程。另外,在没有SDK条件的情况下,”Catalyst apps now behave like AppKit apps when you switch to them with no open windows”(在没有打开窗口时切换过去,Catalyst应用的行为与AppKit应用一致);除非从Dock或Spotlight激活,它们不再创建窗口。
有两个条目,一个在SwiftUI下,一个在Swift Charts下,取决于编译器而不是链接,但同样属于这里。@State宏的重写“back-deploys to iOS 17 aligned OSes”(向后部署到与iOS 17同代的系统),并改变了Xcode 27下能够编译的范围:某些既带初始值、又在init中赋值的声明不再能编译,用Apple的话说是”some such cases”,而合成的私有初始化器也会消失。排查方法见@State宏一文。而Swift Charts条目列为已修复,描述了一个警告和可能的运行时崩溃:”When your project has a minimum deployment target lower than 27.0, using conditionals inside a Chart closure produces the warning”,内容涉及_ConditionalContent的遵循,“and the app might crash at runtime when that content is loaded.”(加载该内容时应用可能在运行时崩溃)引用的警告中平台名称为空,看起来像是beta期间的诊断信息,我也无法复现:9月26日,我让一个Chart的闭包用if在BarMark和LineMark之间分支,针对27.0 SDK分别以26.0和27.0为部署目标做类型检查,均没有任何诊断。条目中运行时崩溃的那一半是Apple的原文,在此仍未经测试。23
完全不重新构建会改变什么?
说明的另一半描述的是操作系统本身,这些变更适用于你去年发布的二进制文件。2
- 菜单符号图片消失。 AppKit:”By default,
NSMenuhides all menu item symbol images”,而且该变更适用于”to applications linked on macOS 26.0 and later”,因此用Xcode 26构建的应用无需重新构建,就会在27的机器上失去符号图片;覆盖手段是NSMenuItem上的preferredImageVisibility(API_AVAILABLE(macos(27.0))),xib检查器中的“macOS 26.0 only”复选框是第二个开关。SwiftUI:“By default, SwiftUI now hides all menu item symbol images in most contexts, while non-symbol images remain visible,”(在大多数场合隐藏符号图片,非符号图片仍然可见),保留图片的开关是labelStyle(_:)和.titleAndIcon,条目中没有SDK条件。UIKit:“On iPadOS 27.0 and macOS 27.0, the menu bar and context menus present a reduced set of menu item images and do not display images set on menu elements by default,”(菜单栏和上下文菜单只显示精简的一组图片,默认不显示设置在菜单元素上的图片),UIMenuElement上有preferredImageVisibility,同样没有SDK条件。头文件与系统层面的解读一致:NSMenuItem.image上的注释写道“in macOS 27 and later, AppKit determines the visibility of menu item images, and will typically hide images.”(在macOS 27及更高版本中,由AppKit决定菜单项图片是否可见,通常会隐藏)3 - 手势变为独占。 “Only the initial hit-tested view hierarchy will activate gesture recognizers until all gestures terminate. A new
exclusiveGestureBehaviorproperty onNSViewallows you to opt-out of this exclusive behavior on a per-view-hierarchy basis. Further, theInfo.plistkeyNSViewGestureRecognizerIsExclusiveallows you to opt-out for the entire app.”(在所有手势结束之前,只有最先命中测试的视图层级会激活手势识别器;可用exclusiveGestureBehavior按视图层级退出,用NSViewGestureRecognizerIsExclusive对整个应用退出)配套的键NSGestureRecognizerSuppressesMainMenuActions可让主菜单操作在手势进行中照常触发;此外“stuck gestures are automatically cancelled after user input has ended for a few seconds,”(用户输入结束几秒后,卡住的手势会被自动取消),并提供NSCrashOnStuckGestureTimeout默认值,便于在调试时把这种情况变成崩溃。父视图上过去与子视图识别器同时触发的识别器,现在要等待了。 - 自定义识别器必须自行定位。 列为已修复:基类
NSGestureRecognizer的locationInView:“now returnsNSZeroPointand logs an error pointing the developer at the missing override. CustomNSGestureRecognizersubclasses must provide their ownlocationInView:implementation.”(现在返回NSZeroPoint,并记录一条指出缺失覆盖的错误;自定义子类必须提供自己的实现)另一个条目说明,诊断用的默认值NSGestureRecognizerCrashOnMissingOverrides是为了”to help developers findNSGestureRecognizersubclasses that are missing required overrides to ensure that they always reach a terminal state”(帮助开发者找出缺少必要覆盖、因而无法保证到达终止状态的子类);至于它是否也能捕获缺失的locationInView:,说明没有交代。另外,NSClickGestureRecognizers“with a click count greater than 1 will send an action before their multi-click timeout has elapsed.”(点击次数大于1时,会在多次点击超时之前就发送操作) launchd与隔离属性。 列为已修复:”launchdno longer supports loadinglaunchdproperty list files with the quarantine extended attribute.”(不再支持加载带有隔离扩展属性的属性列表文件)Apple的已修复条目有时描述旧的缺陷,有时描述新的规则;若按规则理解,带着该属性安装的、下载而来的代理plist将不再被加载。- TCC。 在弃用条目下:“Apps can no longer access the local TCC database directly.”(应用不能再直接访问本地TCC数据库)
- 容器与XProtect。 在System Integrity Protection下:“Accessing files in other developer teams’ app data containers and app group containers no longer prompts the user for authorization; such accesses are denied by default and can be managed by the user in Privacy & Security settings.”(访问其他开发团队的应用数据容器和App Group容器中的文件时,不再提示用户授权;此类访问默认被拒绝,由用户在Privacy & Security设置中管理)还有:“XProtect may now restrict access to app data that is commonly targeted by malicious software.”(XProtect现在可能限制对常被恶意软件盯上的应用数据的访问)Privacy & Security的已知问题补充说“a process without a bundle ID cannot be granted access to specific app data containers or app group containers owned by other developer teams,”(没有bundle ID的进程无法被授予访问其他团队所拥有的特定容器的权限),替代方案是Full Disk Access。
- 受管流量的TLS。 “Starting in 27.0 operating systems, select system processes now enforce stricter network security (TLS) requirements,”(从27.0系统开始,部分系统进程执行更严格的TLS要求),点名了MDM、DDM、Automated Device Enrollment、描述文件安装、应用安装和软件更新;“Servers must support TLS 1.2 at minimum, using cipher suites and certificates that meet App Transport Security (ATS) requirements.”(服务器至少须支持TLS 1.2,并使用符合ATS要求的密码套件和证书)检查清单见TLS审计一文。
- Rosetta。 “On launch, Applications previously set to “Open using Rosetta” by a user will have the application launch natively,”(用户此前设为“Open using Rosetta”的应用,启动时将以原生方式运行)“If Rosetta was previously installed, it is not automatically restored after upgrading to macOS 27.0,”(此前安装过的Rosetta在升级到27.0后不会自动恢复)而未指定
hostArchitecture的安装包“will now default to arm64.”(现在默认为arm64)GA一文在26.6.2上复现了这个安装器默认值。 - 后台的Neural Engine。 这个条目位于macOS页面,开头却是“iOS 27 includes Neural Engine improvements for Apple Intelligence capable devices”,所以应把它读作跨平台共用的说明:“The system now restricts background access to the Neural Engine, similar to GPU usage restrictions,”(系统现在限制后台访问Neural Engine,与GPU使用限制类似)以及“Neural Engine memory usage is now attributed to your app process instead of the system, and appears in the Allocations instrument.”(Neural Engine的内存用量现在计入你的应用进程而不是系统,并显示在Allocations工具中)另一个Core AI条目说,后台访问“requires the new entitlement: “com.apple.developer.background-tasks.continued-processing.inference”.”(需要新的授权)
- 日志归档。 “Unified Logging System archives generated on 27.0 releases cannot be read on macOS 26.1 or earlier due to an updated archive format. macOS 26.2 or later is required to read these archives.”(27.0生成的归档因格式更新,无法在macOS 26.1或更早版本上读取,需要26.2或更高版本)如果你的支持流程要在较旧的Mac上打开客户的
.logarchive包,至少需要26.2。 - 文件承诺会断言。 列为已修复:
receivePromisedFilesAtDestination:“asserts that it is called during-prepareForDragOperation:,-performDragOperation:, or-concludeDragOperation:. IfreceivePromisedFilesAtDestination:...is called at other times, your application will throw an exception and terminate.”(会断言自己是在这几个拖放阶段中被调用的;在其他时间调用,应用将抛出异常并终止)把这个调用推迟到之后某一轮运行循环的接收方,现在会被终止。
27.0中弃用了哪些API?
说明在11个领域的弃用标题下共有13个条目。发行说明里的弃用是一句话;SDK里的弃用是编译器会读取的可用性标注,两者说的并不总是一回事。我把每个条目都对照了Xcode 27内macOS 27.0 SDK的头文件和Swift接口:23
| 说明条目 | SDK中的内容 |
|---|---|
“The originalFilename property on PHAssetResource is incorrectly marked as non-nullable, which misrepresents the property value; a new, nullable filename property is available as a replacement.”(该属性被错误标为非空,改用可为空的新属性filename) |
PHAssetResource.h中为API_DEPRECATED("Use filename instead", ios(9, 27), macos(10.15, 27), tvos(10, 27), visionos(1, 27)) |
“The FileDocument protocol is deprecated. Use ReadableDocument for read-only documents or Document for documents that support reading and writing.” |
FileDocument上为@available(macOS, introduced: 11.0, deprecated: 100000.0, message: "Conform your type to Document instead."):软弃用,目前不会警告。ReadableDocument、WritableDocument和Document都在接口中 |
“The calendar.deleteEvents schema has been renamed to calendar.deleteEvent.” |
macOS的AppIntents接口中deleteEvents出现0次,deleteEvent出现1次。没有别名的改名,对仍使用旧名称的人来说就是编译错误 |
“The DVDPlayback framework has been removed from the macOS 27 Golden Gate SDK and apps cannot build against it. The framework will be removed in a future macOS release.”(已从SDK中移除,应用无法针对它构建;框架本身将在未来的macOS中移除) |
磁盘上的SDK并未移除它:MacOSX27.0.sdk/System/Library/Frameworks/DVDPlayback.framework包含一个.tbd,为x86_64-macos、arm64e-macos和arm64e.x1-macos目标导出223个不同的_DVD符号,还有Headers文件夹和一个模块映射。import DVDPlayback在部署目标26.0下能通过类型检查,DVDInitialize()上带有“deprecated in macOS 10.15”警告;在目标27.0下,同一调用是错误“unavailable in macOS: No longer supported”。所以“cannot build against it”在最低版本27.0时借助可用性标注成立,而存根依然存在 |
| “Encrypted HFS+ (CoreStorage) is deprecated and will not be supported in a future version of macOS.” | 是文件系统格式,不是API;请备份到加密APFS |
| “Apps can no longer access the local TCC database directly.” | 不是标注,而是系统强制执行的策略 |
| “Apps built with the latest SDK must adopt the scene-based life cycle or they fail to launch.”(属于UIKit,因此涉及Mac Catalyst) | 是启动失败,不是警告 |
| “If Rosetta was previously installed, it is not automatically restored after upgrading to macOS 27.0.” | 系统行为 |
“Installer packages which specify no hostArchitecture will now default to arm64.” |
系统行为;已在GA一文中于26.6.2上复现 |
| “Intel-based plugins and loaders may not appear in Settings or trigger notifications of their incompatibility. All Intel-based software will no longer be compatible with macOS 28.0, excluding legacy games.”(基于Intel的插件可能不会出现在设置中,也不会提示不兼容;除旧版游戏外,所有基于Intel的软件将不再兼容macOS 28.0) | 系统行为;Apple列出的插件文件夹是~/Library/Audio/Plug-Ins/*、~/Library/Printers/和~/Library/ColorPickers/ |
| “AirPort Utility is no longer included with new clean installations of macOS.” | 是应用,不是API |
“Meshes compressed using the USDKit export API or usdcrush tool in Beta 1 cannot be decoded by Beta 2, and meshes from Beta 2 cannot be decoded by Beta 1.” |
一条beta之间的说明,一直留到了GA页面 |
| “Weather Highlights is currently only available in US English.” | Apple把它归在弃用之下;读起来是一条可用范围说明 |
弃用标题之外还有一项软弃用,与iOS说明中的那一项相同:.roundedBorder在macOS上为deprecated: 100000.0,消息是”Use textFieldStyle(.bordered) with textInputBorderShape(.roundedRectangle)“,与引入TextInputBorderShape的新功能条目相呼应。3
硬弃用比看上去更安静。编译器拿弃用版本与你的部署目标比较,而不是与SDK比较,所以macos(10.15, 27)只在最低macOS为27.0的目标中才会产生警告。我对一个文件做了类型检查:它读取originalFilename、让一个类型遵循FileDocument、并应用.roundedBorder,针对27.0 SDK分别使用两个目标:在arm64-apple-macos26.0下编译通过,没有任何诊断;在arm64-apple-macos27.0下恰好产生一条,'originalFilename' was deprecated in macOS 27: Use filename instead。FileDocument和.roundedBorder在两个目标下都毫无声息。3 最低版本设得切合实际的Mac应用,不会从编译器那里听到其中任何一项;下文清单中的grep才是提醒。
哪些新功能会影响你已有的代码?
Mac上的下拉刷新。 “In macOS 27.0, AppKit adds NSRefreshController, providing pull-to-refresh functionality for NSScrollView. You can set it with NSScrollView.refreshController, configure a target or action to handle user-initiated refreshes, and call endRefreshing when the refresh completes or beginRefreshing to start one programmatically.”(为NSScrollView提供下拉刷新;用目标或操作处理用户发起的刷新,完成时调用endRefreshing,以编程方式开始时调用beginRefreshing)该类和NSScrollView上的refreshController属性在SDK中都是API_AVAILABLE(macos(27.0))。23
基于手势的文本选择。 “NSTextSelectionManager provides common text selection interactions (click, drag, shift-click, double/triple-click word/line/paragraph selection) to a NSView with a set of NSGestureRecognizers rather than overriding NSEvent mouse methods. NSTextView now uses NSTextSelectionManager“(用一组手势识别器提供常见的文本选择交互,而不是覆盖NSEvent鼠标方法,NSTextView现在也使用它),并且”Existing NSTextView subclasses that override mouseDown: continue to work through a binary-compatible fallback path.”(覆盖了mouseDown:的现有子类,会通过二进制兼容的回退路径继续工作)该类为macos(27.0)。23 结合上文的独占规则:覆盖mouseDown:的自定义文本视图仍能工作,但你挂在它旁边的手势识别器,现在可能要让位于管理器自己的识别器。
用于标签页的角色。 NSToolbarItemGroup和NSSegmentedControl新增role属性,两者都是API_AVAILABLE(macos(27.0)),并配有NSToolbarItemGroup.Role(automatic、tabs、valueSelection)和NSSegmentedControlRole;说明称tabs角色会“read by VoiceOver as “tabs””(被VoiceOver读作标签页),并具有“a distinct visual appearance.”(独特的视觉外观)SwiftUI的TabsPickerStyle是同一个思路,检查器会在重新构建时自动采用它。23
关闭Hot Corners。 “NSApplication.presentationOptions now includes the .disableScreenCornerInteractions option, which you can use to disable Hot Corners.”(新增可用于关闭Hot Corners的选项)在头文件中它是NSApplicationPresentationDisableScreenCornerInteractions,API_AVAILABLE(macos(27.0)),选项掩码的第15位,上方的注释写道”.autoHideDock or .hideDock must also be set for this option to take effect.”(必须同时设置.autoHideDock或.hideDock,此选项才会生效)23
文档体系重写。 “In apps built with the 27.0 SDKs, the new ReadableDocument and WritableDocument protocols support asynchronous reading and writing, progress reporting, and direct access to document URLs,”(新协议支持异步读写、进度报告以及直接访问文档URL),Document合二为一,而FileDocument和ReferenceFileDocument“now deprecated.”。随后三个条目改变了现有的遵循:FileWrapperDocumentWriter的makeFileWrapper闭包”now receives a second argument, previous: FileWrapper?,”(现在接收第二个参数),并且”Existing call sites must update their closures to accept the new parameter”(现有调用处必须更新闭包);read(from:progress:)和write(content:to:previous:progress:)这两项要求”declared with @concurrent instead of nonisolated,“,因此”Conforming types that previously used nonisolated should switch to @concurrent to match”(之前使用nonisolated的遵循类型应改为@concurrent);而URLDocumentConfiguration“no longer conforms to Sendable.”。新的fileExporter重载可在一个对话框中导出一组WritableDocument值。同一领域的已知问题是:进度“might not be presented.”(可能不会显示)2
图片、边框、滑块、菜单。 “AsyncImage now automatically caches downloaded images using HTTP caching protocols,”(按HTTP缓存协议自动缓存下载的图片),可用URLRequest初始化器和View.asyncImageURLSession(_:)加以控制。TextInputBorderShape和textInputBorderShape(_:)随.bordered样式一同到来。”On macOS, the Slider implementation no longer uses NSSlider,”,带边框的Menu和Picker按钮也”no longer use NSPopUpButton in their implementation,”,所以假定底层是AppKit控件的自定义绘制或辅助功能代码,将无从下手。GeometryProxy新增concentricCornerRadii和concentricCornerRadii(in:)。接受数据项的alert和confirmationDialog修饰符现在可回溯到macOS 12.0。2
StoreKit。 “Offer code redemption APIs now return a VerificationResult when redemption completes,”(优惠代码兑换API在兑换完成时返回VerificationResult),Transaction.OwnershipType.assigned和Transaction.RevocationType.assignmentRevoked“support volume purchases,”(支持批量购买),而且”Transaction query methods now additionally return transactions assigned to the Managed Apple Account.”(查询方法还会返回分配给Managed Apple Account的交易)Product.ProductType新增订阅Bundle和Suite,并配有Product.SubscriptionInfo.BundledSubscription;Advanced Commerce信息中加入了partnerName和partnerId。接口中有assigned和BundledSubscription,但撤销这个case的拼写与说明不同。SDK中没有任何文件包含assignmentRevoked;StoreKit接口在Transaction.RevocationType上声明的是public static var assignmentRevocation,原始值为ASSIGNMENT_REVOKE。这个case是@available(macOS 26.4, *)并带有@backDeployed(before: macOS 27.0),所以.assignmentRevocation在27.0目标下能通过类型检查,低于该最低版本时则需要if #available(macOS 26.4, *);说明中的名称在任何目标下都找不到对应的成员。按所有权类型筛选交易的Mac应用,现在会看到第三个值。23
Swift中的stat。 “System now provides Swift APIs for the C stat, lstat, fstat, and fstatat system calls,”(为C的这几个系统调用提供Swift API),带来Stat类型和FilePath.stat();说明还把一项冲突列为已修复:”Custom FilePath or FileDescriptor extensions that make unqualified calls to stat() or stat(_) (without the Darwin. qualification) might conflict with the new Swift stat() instance methods.”(不加Darwin.限定直接调用stat()的自定义扩展,可能与新的实例方法冲突)public struct Stat就在System接口中。23
磁盘映像、虚拟机、Gatekeeper。 “The new DiskImageKit framework provides Swift APIs for creating and managing standalone and stacked disk images in the Apple Sparse Image Format (ASIF) and raw disk image formats, for use with the Virtualization framework via VZDiskImageStorageDeviceAttachment.”(用Swift API创建和管理ASIF及raw格式的独立和堆叠磁盘映像,通过VZDiskImageStorageDeviceAttachment供Virtualization使用)该框架已在SDK中。Virtualization的vmnet端口转发“now support[s] port forwarding when communicating over loopback,”(在环回通信时也支持端口转发),spctl新增一个purge命令,“which will clean up Gatekeeper database entries for apps and executables which are no longer mounted.”(清理已不再挂载的应用和可执行文件的Gatekeeper数据库条目)对于用脚本操作虚拟机的人,磁盘映像API的用武之地在容器一文。23
游戏控制器、视频、Metal。 “The PlayStation® Access™ controller is now supported on macOS, iPadOS, and iOS.” VTLowLatencySuperResolutionScalerConfiguration“now supports a 1.5x scale factor,”,帧插值“supports arbitrary source dimensions up to 1080p.”(支持最高1080p的任意源尺寸)两项Metal修复涉及clamp-to-edge采样器返回零的问题,其中一项专属于“the Apple 10 GPU family.”。2
Foundation。 NSURL的修复在这里以与iOS说明相同的措辞出现:”+[NSURL URLWithString:] no longer double-encodes the % of valid percent-escape sequences when encoding other invalid characters.”(在编码其他无效字符时,不再对合法百分号转义序列中的%做二次编码)在iOS一文中,我证明了这项修复跟随代码运行时所在的操作系统,而同一段代码的Mac构建在macOS 26.6.2上仍产生旧的%2520结果;在27.0上应得到新结果,在所有26.x上则是旧结果。2
硬件安全。 “arm64e.x1 introduces additional hardware security and performance instructions, including CPA2 for stronger MIE protection,”(引入更多硬件安全和性能指令,包括用于加强MIE保护的CPA2),适用于“Mac computers with M6 or later chips”;上文DVDPlayback存根的目标列表,就让人实际看到了这个切片名称。构建设置见arm64e.x1一文。23
需要提前规划的已知问题
photos.asset实体无法编译。 “Existing entities that conformed to @AppEntity(schema: .photos.asset) in prior releases might no longer compile in the 27 SDKs because new properties were added to the schema in this release.”(由于此版本为该schema新增了属性,先前版本中遵循它的实体可能无法在27 SDK中编译)解决办法是在可用性检查之内采用这些属性;元数据处理器要求的12个属性列在iOS发行说明一文中,macOS说明中也有同一条目。2- 音频schema与Siri。 “If you adopt the Audio App Schema domain, you might have trouble playing your content using Siri.”(采用Audio App Schema域后,可能难以用Siri播放你的内容)解决办法:“Adopt an IntentValueQuery that takes the AudioSearch input, or index your entities in Spotlight.”(采用接受AudioSearch输入的IntentValueQuery,或在Spotlight中索引你的实体)2
SpotlightSearchTool撑爆设备端模型。 若不加配置,“the tool’s description and parameter schema alone exceed the on-device model’s context window before any prompt is added”(还没加入任何提示词,工具描述和参数schema本身就超出了设备端模型的上下文窗口);解决办法是使用聚焦的指引,例如.focused(.documents)。2- 无bundle的进程与Files & Folders。 没有bundle ID的进程“cannot be granted access to specific app data containers or app group containers owned by other developer teams,”,Apple给出的变通办法是“for the duration of the requirement.”(在需要期间)授予Full Disk Access。读取其他应用容器的命令行工具就属于这种情况。2
- 未签名的Safari扩展。 开发时,“unsigned extensions might not appear until rebuilt when using the “Allow Unsigned Extensions” checkbox.”(即使勾选了“Allow Unsigned Extensions”,未签名扩展也可能在重新构建之前不出现)2
- StoreKit测试。 “Changing the storefront or locale using
SKTestSessiondoesn’t propagate throughStorefront.updates,”(用SKTestSession更改店面或区域设置,不会通过Storefront.updates传递出来),以及失败的购买”might display error dialogs even whendialogsDisabledis set to true.”(即使dialogsDisabled为true,也可能显示错误对话框)两项在27.2 beta 2说明中都已列为修复,同时新增一项:购买订阅包中的某个订阅时,“incorrectly allows the user to unbundle instead of throwing an error.”(错误地允许用户拆分订阅包,而不是抛出错误)24 - Shortcuts。 使用
Duration或LPLinkMetadata的意图在“Describe a change”下“might fail”(可能失败),带有两种数字类型的UnionValue参数会把选项显示两次;只声明一种即可。2 - 从macOS 11选择启动磁盘。 “When a Mac is running macOS 11.0, you might not be able to select the boot volume of macOS 27.0 or later as the startup disk in System Settings.”(Mac运行macOS 11.0时,可能无法在System Settings中把macOS 27.0或更高版本的启动卷选为启动磁盘)变通办法是按电源键调出启动选择器。2
- Siri,六项。 搜索后的照片选择、Siri关闭时仍出现“Ask Siri”、无法对特定照片使用语音命令、地图摘要不完整、添加到相簿的计数,以及第三方应用的Siri结果中非SF Symbol的实体图片不显示。如果你的实体带有自定义图片,最后一项需要你自己检查。2
我无法运行的部分
这台Mac运行的是macOS 26.6.2,而27的机器我至今仍没有。本文中每一项系统层面的行为都是Apple的原文,以引用形式给出并注明;上文没有任何一处说macOS 27系统做了什么是我亲眼所见。我能运行的是SDK:Xcode 27(27A266a)会把macOS 27.0 SDK(26A425)带到任何能安装它的Mac上,所以头文件标注、Swift接口、框架文件夹以及三次类型检查都是真实的,日期为9月26日。SDK与说明不一致的两处,即DVDPlayback存根和撤销case的拼写,我报告的是SDK所呈现的内容,而不是对27的机器在运行时会怎样做的断言。3
这周我会做什么
- 用Xcode 27归档一次,在公证之前拿上文“链接到27后”的清单逐项核对应用:菜单项图片、任何设置了内容类型的打开面板、任何遍历
NSTextView上下文菜单的代码、标题栏附件,以及任何继承了控件修饰符的sheet。2 - 赶在用户之前,在27的机器上测试手势:父视图上过去与子视图同时触发的识别器现在是独占的,而缺少
locationInView:的自定义NSGestureRecognizer子类会返回原点并记录日志。请在控制台留意这条Apple称由AppKit产生的错误;NSGestureRecognizerCrashOnMissingOverrides默认值的描述针对的是无法到达终止状态的子类,说明并没有说它涵盖locationInView:。2 - grep一下
originalFilename、FileDocument、ReferenceFileDocument、.roundedBorder、deleteEvents和import DVDPlayback;第一个只在27.0目标下警告,接下来三个是软弃用、毫无声息,deleteEvents已不复存在,而import DVDPlayback会在你把最低版本提升到27.0的那天变成错误。3 - 如果你通过下载分发代理或守护进程,请在安装时去掉属性列表上的隔离属性,或者改走一条根本不会带上该属性的安装路径;Apple的说明列出27上的
launchd不再加载此类文件。2 - 如果你读取其他团队的容器,请删除这段代码,或改经Full Disk Access;提示已经没有了,默认就是拒绝。2
- 在错误报告中记录两处的版本号:机器上的
ProcessInfo,以及构建用Mac上SDK的SystemVersion.plist。两者不同,26A428对26A425,一处已包含的修复,另一处未必包含。3
常见问题
macOS 27是什么时候发布的,版本号是多少?
2026年9月14日(周一),版本号26A428,在Apple的Releases信息源中与Xcode 27及其他27.0系统一同列出。Xcode 27内的SDK自称26A425。13
macOS 27.0.1发布了吗?
截至2026年9月26日还没有。Apple的macOS发行说明索引列出了“macOS 27 Golden Gate Release Notes”和“macOS 27.2 Golden Gate Beta 2 Release Notes”,两者之间没有其他条目,Releases信息源中也没有任何平台的27.0.1。一旦发布,本文会加上注明日期的说明。17
macOS 27的发行说明在哪里?
在Apple开发者文档网站的macOS Release Notes下,每个版本一页,标题为“macOS 27 Golden Gate Release Notes”,共86个领域,General排在最前,随后从Accessory Access一直到XQuartz。27.2 beta的说明是单独的一页,短得多。24
macOS 27弃用了什么?
弃用标题下共13个条目:PHAssetResource.originalFilename、FileDocument、calendar.deleteEvents改名、DVDPlayback框架、加密HFS+、直接访问TCC数据库、Catalyst场景生命周期强制要求、三项Rosetta条目、全新安装不再附带AirPort实用工具、一条USDKit beta说明,以及一条Weather Highlights语言说明。只有前四项是API。originalFilename只在部署目标为27.0时才出现警告,FileDocument保持沉默,deleteEvents无法编译,DVDPlayback在低于27.0的最低版本下警告,在27.0下失败。23
我的应用需要为macOS 27重新构建吗?
不需要,而且改变部分行为的恰恰是重新构建。链接到27后的条目只在你用27 SDK归档时才会触发;手势、launchd、TCC、容器、TLS和Rosetta方面的变更,无论是否重新构建,都适用于27机器上的每一个二进制文件;而在macOS 26.0或更高版本上链接的应用,在那里已经会失去菜单符号图片。2
DVDPlayback从SDK中消失了吗?
没有从磁盘上的27.0 SDK中消失:框架文件夹、它的.tbd、头文件和模块映射都存在于Xcode 27的MacOSX27.0.sdk中。它的函数在部署目标27.0下标为不可用,低于该版本时标为自10.15起弃用,因此最低版本为27.0的项目无法针对它构建,这与说明所言一致;最低版本更低的项目仍然可以构建,只是带有警告。3
macOS 27上的Mac Catalyst有哪些变化?
场景生命周期强制要求适用;链接macCatalyst 27 SDK时可以使用UIScene.extendStateRestoration和completeStateRestoration;在没有窗口时切换过去,除非从Dock或Spotlight激活,Catalyst应用不再创建窗口;UIStepper在Mac风格下可以工作;边栏工具栏按钮缺失的问题列为已修复。Xcode 27.2 beta说明还提醒,那里的macOS SDK“incorrectly report[s] 27.1 as a valid deployment target,”(错误地把27.1报告为有效的部署目标),并且以27.1或27.2为目标的Catalyst构建“may be unable to use newly introduced API.”(可能无法使用新引入的API)25
来源
-
Apple,Releases,2026年9月26日获取的RSS订阅源:2026年9月14日(周一)日期下有“macOS 27.0 (26A428)”和“Xcode 27 (27A266a)”;2026年9月21日(周一)日期下有“macOS 27.2 beta 2 (26B5091g)”;直到最新的条目、9月24日的“TestFlight 4.4.0”,任何平台都没有macOS 27.0.1的条目。 ↩↩↩↩↩↩↩
-
Apple,macOS 27 Golden Gate Release Notes,2026年9月26日获取。引用的条目按radar编号列出:AppKit 170477566、177605020、180962967、6938919、173975472、176048351、176395420、179374305、179936632、160867808、162577742、163365571;App Intents 176751155、181800016、177198033;NSGestureRecognizer 173551081、175705302、176396492;NSApplication 168692527;SwiftUI 105893279、158160386、158441552、158441261、177458781、167448274、165913417、175594929、170678002、174628712、180300890、180301399、180302015、180302075、178776840、86580365、151015350、173362083、173990195、68559433、78212597、177185166、179388848、170480710、180301165;UIKit 141837548、161843040、170479084;Mac Catalyst 69906818、57819435、176879915;Launch Daemons and Agents 166415497;TCC 90775556;System Integrity Protection 161835690、178668601;Privacy & Security Settings 184660124;Network Security 176055825;Rosetta 168097174、163213094、171187112、176042635;Core AI 174796039、179282606;Apple Unified Logging System 160567675;PhotoKit 175412725;CoreStorage 175892420;DVDPlayback 179136240;AirPort Utility 158248382;USDKit 177417812;Weather Highlights 164408676;StoreKit 141012819、156749517、160501742、167808780;StoreKit Testing in Xcode 184155259、184255116;System 160612181、177911316;Disk Images 177868758;Virtualization 64203273;Gatekeeper 123097648;Game Controller 168071382;VideoToolbox 177635243、179040806;Metal 172520325、177318505;Foundation 161588649;Hardware Security 152103975;Swift Charts 174168981;Core Spotlight 183770678;Safari 183044008;Shortcuts 166068090、168315587;Startup Disk 166640903;Siri 171728298、176299524、176812955、177116121、177376984、177984074。统计数字(86个领域;68项新功能、173项已解决问题、18项已知问题、13项弃用)为作者对各标题下列表项的计数。 ↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩
-
作者在一台运行macOS 26.6.2的Mac上检查Xcode 27(27A266a)内macOS 27.0 SDK的结果,2026年9月26日:
MacOSX27.0.sdk/System/Library/CoreServices/SystemVersion.plist报告ProductBuildVersion26A425和ProductVersion27.0;PHAssetResource.h在originalFilename上带有API_DEPRECATED("Use filename instead", ios(9, 27), macos(10.15, 27), tvos(10, 27), visionos(1, 27));arm64e-apple-macos的SwiftUI接口在FileDocument上带有@available(macOS, introduced: 11.0, deprecated: 100000.0, message: "Conform your type to Document instead."),在roundedBorder上带有deprecated: 100000.0和textFieldStyle(.bordered)消息;macOS的AppIntents接口中deleteEvent出现1次、deleteEvents出现0次;DVDPlayback.framework包含DVDPlayback.tbd(223个不同的_DVD符号;目标为x86_64-macos、arm64e-macos、arm64e.x1-macos)、Headers/DVDPlayback.h和Modules/module.modulemap;对一个导入DVDPlayback并调用DVDInitialize()的文件执行swiftc -typecheck,在-target arm64-apple-macos26.0下输出“warning: ‘DVDInitialize()’ was deprecated in macOS 10.15: No longer supported”,在-target arm64-apple-macos27.0下输出“error: ‘DVDInitialize()’ is unavailable in macOS: No longer supported”;对一个读取originalFilename、遵循FileDocument并应用.roundedBorder的文件执行swiftc -typecheck,在-target arm64-apple-macos26.0下没有诊断,在-target arm64-apple-macos27.0下输出一条警告“’originalFilename’ was deprecated in macOS 27: Use filename instead”;NSRefreshController.h和NSTextSelectionManager接口为API_AVAILABLE(macos(27.0));NSToolbarItemGroup.h以NS_SWIFT_NAME(NSToolbarItemGroup.Role) API_AVAILABLE(macos(27.0), ios(27.0))声明NSToolbarItemGroupRole,role属性为API_AVAILABLE(macos(27.0)),NSSegmentedControl.h亦然;NSMenuItem.h将preferredImageVisibility声明为API_AVAILABLE(macos(27.0));NSGestureRecognizer.h将cancellableByScrollGesture声明为API_AVAILABLE(macos(27.0));NSApplication.h将NSApplicationPresentationDisableScreenCornerInteractions声明为API_AVAILABLE(macos(27.0)),其值为掩码的第15位;DiskImageKit、NowPlaying和AccessoryAccess框架文件夹存在;System接口声明了public struct Stat;对一个Chart闭包用if在BarMark和LineMark之间分支的文件执行swiftc -typecheck,在-target arm64-apple-macos26.0和-target arm64-apple-macos27.0下均没有诊断;StoreKit接口包含assigned和BundledSubscription,并在Transaction.RevocationType上声明了原始值为ASSIGNMENT_REVOKE的public static var assignmentRevocation,而SDK中没有任何文件包含说明里的assignmentRevoked;该case声明为@available(iOS 26.4, macOS 26.4, tvOS 26.4, watchOS 26.4, visionOS 26.4, *),并带有@backDeployed(before: iOS 27.0, macOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0);ReferenceFileDocument带有@available(macOS, introduced: 11.0, deprecated: 100000.0, message: "Use Document protocol instead.");NSScrollView.h将refreshController声明为API_AVAILABLE(macos(27.0));NSMenuItem.h中image的注释为“in macOS 27 and later, AppKit determines the visibility of menu item images, and will typically hide images”。 ↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩ -
Apple,macOS 27.2 Golden Gate Beta 2 Release Notes,2026年9月26日获取:引用了General 186939138、AppKit 186955507、Notifications 187312007、Shortcuts 187499433、StoreKit Testing in Xcode 183933307、184155259、184255116、186018916。 ↩↩↩
-
Apple,Xcode 27.2 Beta Release Notes,2026年9月26日获取,SDK,Known Issues(187160501),已引用。 ↩
-
Apple,App Store Connect release notes,2026年9月26日获取,2026年9月14日的条目,全文引用于表格中。 ↩
-
Apple,macOS Release Notes,2026年9月26日获取的索引:27的条目为“macOS 27 Golden Gate Release Notes”和“macOS 27.2 Golden Gate Beta 2 Release Notes”。 ↩↩↩