You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询Electron v26修复Mac App Store沙盒下Photos库访问问题的原因

Electron沙盒MAS构建版本中Photos库访问故障的成因分析

我开发了一款通过原生插件访问macOS Photos库的Electron应用,但在启用沙盒的Mac App Store(MAS)构建版本里,该访问功能无法正常工作。

我观察到以下现象:

  • 未启用沙盒的构建版本,可正常访问Photos库;
  • 启用沙盒且使用Electron v26及以上版本构建时,应用能正常访问Photos库;
  • 启用沙盒且使用Electron v25及以下版本(包括v25.9.8)构建时,应用无法访问Photos库,同时出现一系列XPC错误,错误日志如下:
CoreData: XPC: sendMessage: failed #0
CoreData: XPC: Unable to sendMessage: to server
...
CoreData: XPC: sendMessage: failed #7
CoreData: XPC: Unable to connect to server with options {
    NSPersistentHistoryTrackingKey = 1;
    NSXPCStoreServerEndpointFactory = "<PLXPCPhotoLibraryStoreEndpointFactory: 0x7fc67e8af370>";
    skipModelCheck = 1;
}
CoreData: XPC: Unable to load metadata: Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={Problem=Unable to send to server; failed after 8 attempts.}
CoreData: fault: Unable to create token NSXPCConnection.  NSXPCStoreServerEndpointFactory 0x7fc67e8af370 -newEndpoint returned nil
CoreData: error: Failed to create NSXPCConnection

由于Electron v26已不再获得官方团队支持,我希望搞清楚这个问题的成因。测试表明v25.9.8仍会触发上述XPC错误,而v26.0.0则能正常运行。

内容的提问来源于stack exchange,提问作者Hao Xi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 21:33:27