我有一个 Mac 应用程序,我已经有一段时间没有碰过它了。现在,自 macOS Catalina 以来,与 Mac App Store 集成运行应用程序的情况似乎发生了变化 https://stackoverflow.com/q/58673379/1879171.
当我从 XCode 启动该应用程序时,它崩溃并显示退出代码 173 并记录如下,然后提示使用我的 Apple ID 登录,我一生都尝试将其作为沙盒 Apple ID。
无论我使用哪个 Apple ID 登录,都会以错误结束:«“应用程序名称”已损坏,无法打开。»
Logs
Could not check for receipt presence for some reason... Error Domain=NSCocoaErrorDomain Code=260 "The file “receipt” couldn’t be opened because there is no such file." UserInfo={NSURL=Contents/_MASReceipt/receipt -- file:///Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/, NSFilePath=/Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/Contents/_MASReceipt/receipt, NSUnderlyingError=0x600000c86310 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2021-01-08 13:23:07.867823+0100 *********s[87637:4910885] Failed fetch receipt with error: The file “receipt” couldn’t be opened because there is no such file.
Could not check for receipt presence for some reason... Error Domain=NSCocoaErrorDomain Code=260 "The file “receipt” couldn’t be opened because there is no such file." UserInfo={NSURL=Contents/_MASReceipt/receipt -- file:///Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/, NSFilePath=/Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/Contents/_MASReceipt/receipt, NSUnderlyingError=0x600000c8dd40 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2021-01-08 13:23:07.869011+0100 *********s[87637:4910885] Failed fetch receipt with error: The file “receipt” couldn’t be opened because there is no such file.
Could not reach receipt URL: Optional(Error Domain=NSCocoaErrorDomain Code=260 "The file “receipt” couldn’t be opened because there is no such file." UserInfo={NSURL=Contents/_MASReceipt/receipt -- file:///Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/, NSFilePath=/Users/******/Library/Developer/Xcode/DerivedData/*********-egqjyklohxjyjqcvtxjmwzdxvxhv/Build/Products/Debug/**********.app/Contents/_MASReceipt/receipt, NSUnderlyingError=0x600000c8ddd0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}})
2021-01-08 13:23:07.882384+0100 *********s[87637:4910885] No receipt found! Will exit with 173 to let macOS handle renewing a receipt from the App Store.
Setup
- macOS 10.15.7 (19H114)
- XCode 12.3 (12C33) // 也尝试过 XCode 11.7 → 相同相同
- 使用有效开发证书签名的应用程序
您可以通过以下方式修改属性xattr
命令。这样你就可以绕过例如您的错误消息或其他类似的消息应用程序无法打开,因为它不是从 AppStore 安装的 https://osxdaily.com/2012/07/27/app-cant-be-opened-because-it-is-from-an-unidentified-developer/.
不管怎样,启动你的终端并使用:
sudo xattr -cr {path_to_application}/application.app
随着xattr https://www.unix.com/man-page/osx/1/xattr/您可以通过应用查看扩展属性本身(并删除它们)
- the
-c
用于删除所有属性的标志
- and
-r
对目录树指向的所有文件进行操作。
对于两个标志,以及xattr
,我建议阅读本文档 https://www.unix.com/man-page/osx/1/xattr/ page.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)