我正在开发一个 Macos 菜单栏应用程序,由于某种原因,当我将应用程序存档、公证并导出到我的
Applications
文件夹并运行该应用程序时,它会立即崩溃。当我使用控制台应用程序时,我看到以下错误消息:
myapp[30188]: AppSandbox request successful
Channel could not return listener port.
activating connection: mach=false listener=false peer=false name=com.apple.hiservices-xpcservice
activating connection: mach=true listener=false peer=false name=com.apple.window_proxies
invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
[app<application.com.myapp.15235459.15235465(501)>:30188] termination reported by launchd (2, 5, 5)
failed to fetch /Applications/myapp.app/Contents/_CodeSignature/CodeRequirements-1 error=-10
failed to get text offset for /Applications/myapp.app/Contents/MacOS/myapp[30188]: (#3) No such process
RBSStateCapture remove item called for untracked item 378-345-52811 (target:[app<application.com.myapp.15235459.15235465(501)>:30188])
当我在 Xcode 中运行应用程序(在调试模式和发布模式)时,除了 Sparkle 的这条消息之外,没有任何警告消息(我相对确定它与我的问题无关,但为了简洁起见,将其包含在此处):
Warning: Background app automatically schedules for update checks but does not implement gentle reminders. As a result, users may not take notice to update alerts that show up in the background. Please visit https://sparkle-project.org/documentation/gentle-reminders for more information. This warning will only be logged once.
Here 是
.app
文件二进制文件的链接。
我将应用程序的二进制文件交给了朋友,并在控制台应用程序中遇到了这些错误消息,但我自己无法重现它们。
Sandbox: myapp(9044) deny(1) file-read-data /Users/user/Downloads/myapp.app
IDENTITY_ATTRIBUTION: Failed to copy signing info for 9044, responsible for /private/var/folders/nt/40hq8tkx0tgb7c4fw5_n79wr0000gn/T/AppTranslocation/345F7E81-EE9E-4ADF-A66F-589A6647291D/d/myapp.app/Contents/MacOS/myapp: #-67065: Error Domain=NSOSStatusErrorDomain Code=-67065 "(null)"
我已尝试以下方法来阻止应用程序崩溃,但均无济于事:
com.apple.security.automation.apple-events
添加到应用程序权利文件其他背景
包依赖项:
我自己使用“登录时启动”,所以我确信这不是问题。
这个苹果开发论坛线程有相同的错误,但 NSOSStatusErrorDomain 代码略有不同。我认为这与您遇到的问题非常相似。
根据 DTS 工程师的说法,这是一个签名问题。如果您还没有看过,请阅读:https://forums.developer.apple.com/forums/thread/678816
个人经历: 我不确定你遇到了什么问题,但是: