Xcode vs. Gatekeeper

Have you noticed how launching a new beta version of Xcode seems to take forever the first time you do it?

There’s a reason for that and its name is Gatekeeper. When you double-click on that shiny new icon, you’re asking your Mac to compute a checksum on tens of thousands of files using over 5 GB of space. That’s going to take awhile.

If you trust the source of the file, there’s no harm in removing the flag that causes Gatekeeper to perform this check:

$ cd /Applications
$ xattr -d com.apple.quarantine Xcode6-Beta7.app

Now, when you launch that new version it will open up immediately and won’t annoy you with the dialog asking if it’s OK. How many collective developer hours will this little trick save?

For more info on xattr, check this out.

Updated March 10th, 2015: I do not recommend taking this shortcut anymore. It is likely that Xcode has been compromised and can be delivered through an insecure content distribution network. Take the time to verify that the code signature on the package you downloaded matches the one Apple created.

Updated September 9th, 2014: As Greg Parker points out “trusting the source” means that you’re absolutely sure that both the DNS and network between you and Apple hasn’t been compromised. My personal opinion is that if those things happen, I have a much bigger problem than an Xcode download (e.g. someone can watch all my transactions with iTunes.) Your mileage may vary.