Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac 安装程序显示 "已损坏" 如何处理? #3

Open
iAJue opened this issue Nov 5, 2024 · 1 comment
Open

Mac 安装程序显示 "已损坏" 如何处理? #3

iAJue opened this issue Nov 5, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@iAJue
Copy link
Owner

iAJue commented Nov 5, 2024

在 GitHub Actions 上打包的 macOS 应用显示“已损坏”通常是由于 macOS 的安全机制(如代码签名和公证)未通过或被绕过。macOS 要求应用程序进行代码签名,否则在安装或运行时可能会被认为“已损坏”。以下是一些常见的解决方案:

  1. 禁用 Gatekeeper
    在本地运行应用时,您可以通过终端禁用 Gatekeeper 检查(不推荐用于发布,仅用于本地测试):
sudo spctl --master-disable
  1. 绕过“已损坏”提示
    使用以下命令清除应用的扩展属性,避免 macOS 识别为不可信的应用:
xattr -cr /path/to/your/app.app

xattr -cr 会递归清除应用的扩展属性,以解决 macOS 的不信任问题。

@iAJue iAJue added the documentation Improvements or additions to documentation label Nov 5, 2024
@iAJue iAJue pinned this issue Nov 5, 2024
@iAJue iAJue self-assigned this Jan 10, 2025
@iAJue
Copy link
Owner Author

iAJue commented Mar 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant