Basically, if you want an application launch approved by the GateKeeper feature on a Mac, you right-click on the unidentified developers application and choose “Open”, or go through System Preferences to bypass Gatekeeper. But did you know that there's another option to do this? Yes! there is and it is by using the command line in your mac OS X. You can check out the quick guide below on how to add gatekeeper approvals or exeptions from command line in Mac OS X.
Add an Application to Gatekeeper Approval from the Command Line in OS X
To add an application to Gatekeepers exceptions and approved application launch list, use the –add flag with spctl to approve an application launch. The following syntax style is appropriate:
spctl --add /Path/To/Application.app
For example, to add approval for the imaginary application called “GooseRoute” that resides in the users downloads folder, the syntax string would look like the following:
spctl --add ~/Downloads/GooseRoute.app
You’ll need to enter an administrator password to approve the application with Gatekeeper, otherwise you can prefix the command with sudo if you’re performing this from SSH or want to automate the process.
Remove an Applications Gatekeeper Exception with spctl in OS X
Removing an application from the Gatekeeper approval list is just as easy, simply switch out the –add flag with –remove, the syntax is otherwise the same:
spctl --remove /Path/To/Application.app
Again, you can prefix the command with sudo if desired, otherwise the familiar admin authentication pop-up will appear in OS X to complete the removal of the application from Gatekeepers authorization list.
Credits: osxdaily.com