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

天大地大妈咪最大 提交于 2019-12-01 04:15:51

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

The only solution that 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

Some times in below options

  • Open System Preferences
  • Click on "Security & Privacy"

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

sudo spctl --master-disable

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

hope it will work for you.

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 post from Will Lowe that talks about installing an un-signed application.

  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

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.

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

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".

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 :)

Alisina

I found this solution helpful and follow these steps:

  1. run this command into terminal sudo spctl --master-disable it may ask your user password.
  2. go to System Preferences -> security and privacy -> general tab -> check Anywhere option on bottom.

Hope it helps someone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!