修复 Signed With Custom Identity or Adhoc

有的时候安装软件,软件会启动不了。

我在terminal中启动软件,有如以下提示:

1
2
3
4
5
6
/Applications/Application.app ; exit;
dyld: Library not loaded: @rpath/Sparkle.framework/Versions/A/Sparkle
Referenced from: /Applications/Application.app
Reason: no suitable image found. Did find:
/Applications/Application.app/Contents/MacOS/../Frameworks/Sparkle.framework/Versions/A/Sparkle: code signature in (/Applications/Application.app/Contents/MacOS/../Frameworks/Sparkle.framework/Versions/A/Sparkle) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
[1] 15203 abort /Applications/Application.app

从错误信息中看,应该是软件的签名出现了问题,只需要安装Xcode后,对软件重现签名就好了:

1
sudo codesign -f -s - --deep /Applications/Application.app