公司最近为我配备了一台Mac,作为开发这么多年的我,竟然没有用过Mac,甚是惭愧。
在搭建开发环境的时候,用到了公司自己的软件,暂时命名为A,从公司内网下载下来后,却不能通过双击打开。由于我是MacOS小白,只能到处找资料。
在公司的内网的FAQ中找到了原因:
The root cause for this is that starting from Mountain Lion, Apple has tightened its security when installing apps. The default security preference (which can be changed) is that only apps from the Mac AppStore and/or from certified Apple developers can be installed. Mac looks for signature/certs to validate this.
- Workaround: Go to System Preferences --> Security --> General and check Anywhere radio to proceed with the installation.
- Workaround: Launch installer by right-clicking or Control-clicking its icon and choosing Open.
原来为了系统安全,Apple默认禁止在Mac中安装非Mac AppStore和非Apple认证的开发者的软件。
我按照提示依次打开了System Preferences --> Security --> General菜单,却并没有找到这个叫做“Anywhere”的选项:
后来,在搜索中看到这篇文章,里面详细介绍了如何让General面板中出现Anywhere:
sudo spctl --master-disable
输入密码后,再次打开System Preferences --> Security --> General菜单:
可以看到“Anywhere”的选项出现了。接下来点击下方的“Click the lock to make changes” 解锁后即可修改。
最后,程序A可以通过双击打开了(不用将其拖到Applications文件夹中)。