Whether you downloaded Xcode from Apple or received it from another source, you can easily verify the integrity of your copy of Xcode. You may need to do this to make sure you aren't running a compromised version of the software.
Here's how to do it:
Step One Launch a new Terminal window from Applications:Utilities.
Step Two Enter the following command into the Terminal window, where /Applications/ is the directory where Xcode is installed. You must be on a system with Gatekeeper enabled.
spctl --assess --verbose /Applications/Xcode.app
Step Three After several minutes, the result of the validation test will be presented. If your copy is valid you will see one of these three messages.
/Applications/Xcode.app: accepted source=Mac App Store
/Applications/Xcode.app: accepted source=Apple
/Applications/Xcode.app: accepted source=Apple System
Add Comment
Would you like to be notified when someone replies or adds a new comment?
Yes (All Threads)
Yes (This Thread Only)
No
Notifications
Would you like to be notified when we post a new Apple news article or tutorial?