“Xcode”已损坏,无法打开。你应该把它移到垃圾箱

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26434518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:54:23  来源:igfitidea点击:

“Xcode” is damaged and can’t be opened. You should move it to the Trash

xcodemacosxcode6osx-yosemite

提问by danfelabs

Installed XCode 6on Mavericks. It din't run. Updated OS to Yosemite 10.10: Now Xcode.app (installed through *.dmg) launch fails with error message “Xcode” is damaged and can't be opened. You should move it to the Trash.Updated to XCode 6.0.1through App Store. Still no luck. Same error message. Anyone with a fix?

安装XCode 6Mavericks. 它不运行。将操作系统更新为Yosemite 10.10:现在 Xcode.app(通过 *.dmg 安装)启动失败并显示错误消息“Xcode” is damaged and can't be opened. You should move it to the Trash.XCode 6.0.1通过 App Store更新。仍然没有运气。同样的错误信息。有修复的人吗?

enter image description here

在此处输入图片说明

回答by Arnaud Nelissen

I experienced this error with any new added application under (all) macOS Sierra builds.

我在(所有)macOS Sierra 版本下使用任何新添加的应用程序都遇到了此错误。

The only solutionthat worked for me was to execute :

对我有用的唯一解决方案是执行:

xattr -rc /Applications/<faulty application>.app

You can also use the following command to "repair" all applications :

您还可以使用以下命令“修复”所有应用程序:

xattr -rc /Applications/*.app

回答by Maishi Wadhwani

Some times in below options

有时在以下选项中

  • Open System Preferences
  • Click on "Security & Privacy"
  • 打开系统偏好设置
  • 点击“安全和隐私”

enter image description here

在此处输入图片说明

Allow apps downloaded from contains only 2 options "AnyWhere" is missing for that open your terminal and add below line

允许下载的应用程序只包含 2 个选项“AnyWhere”缺少打开终端并添加以下行

sudo spctl --master-disable

enter your system password. Now you quit System Preferencesand reopen it System Preferences/Security & Privacy/Generalnow "AnyWhere" option will be there. Hurrah You have done it.

输入您的系统密码。现在您退出系统偏好设置并重新打开系统偏好设置/安全和隐私/通用现在“AnyWhere”选项将在那里。万岁你做到了。

Problem solvedhope it will work for you.

问题解决了希望它对你有用。

回答by bto

I know this is an older question, but if you're like me and absolutely want to install Xcode from a DMG and not from the App Store, there is a way, inspired by this postfrom Will Lowe that talks about installing an un-signed application.

我知道这是一个较老的问题,但是如果您像我一样并且绝对想从 DMG 而不是从 App Store 安装 Xcode,那么有一种方法,灵感来自 Will Lowe的这篇文章该帖子谈到安装一个非-签署的申请。

  1. Install the DMG as usual (Double-click, Drag-n-drop)
  2. Open System Preferences
  3. Click on "Security & Privacy"
  4. Adjust the "Allow applications downloaded from:" setting to "Anywhere"
  5. Open Xcode
  6. Be patient while it verifies and opens
  1. 像往常一样安装 DMG(双击,拖放)
  2. 打开系统偏好设置
  3. 点击“安全和隐私”
  4. 将“允许从以下位置下载的应用程序:”设置调整为“任何地方”
  5. 打开 Xcode
  6. 在验证和打开时要有耐心

You only need to do this the first time you open Xcode, so you can change your Security settings back to their original value after Xcode has fully launched.

您只需在第一次打开 Xcode 时执行此操作,这样您就可以在 Xcode 完全启动后将您的安全设置改回其原始值。

回答by user3508568

If you trust the people from whom you are downloading things you can bypass the warning by adjusting your ‘Preferences > Security & Privacy' to

如果您信任从其下载内容的人,您可以通过将“首选项 > 安全和隐私”调整为

Allow applications downloaded from: Anywhere

允许从以下位置下载应用程序:任何地方

回答by theLastNightTrain

I have just experienced this with Xcode 6.1.1 on Yosemite, except it only happened when I build and run in the simulator - on app launch Xcode would crash and a panel would declare "Xcode is damaged. Delete it and download again from the App Store".

我刚刚在 Yosemite 上使用 Xcode 6.1.1 遇到过这种情况,除非它只发生在我在模拟器中构建和运行时 - 在应用程序启动时 Xcode 会崩溃并且面板会声明“Xcode 已损坏。删除它并从应用程序再次下载店铺”。

I did all of the following to solve it:

我做了以下所有事情来解决它:

  • Delete derived project data and full clean
  • Delete app from simulator and quit simulator
  • Reboot
  • 删除派生项目数据并完全清理
  • 从模拟器中删除应用程序并退出模拟器
  • 重启

Anyway just in case this helps a new visitor to this question :)

无论如何,以防万一这有助于这个问题的新访客:)

回答by Alisina

I found this solution helpful and follow these steps:

我发现这个解决方案很有帮助,并按照以下步骤操作:

  1. run this command into terminal sudo spctl --master-disableit may ask your user password.
  2. go to System Preferences-> security and privacy-> general tab-> check Anywhereoption on bottom.
  1. 将此命令运行到终端中,sudo spctl --master-disable它可能会询问您的用户密码。
  2. 转到系统偏好设置->安全和隐私->常规选项卡-> 检查底部的任何地方选项。

Hope it helps someone.

希望它可以帮助某人。