MATLAB Answers

MEX file cannot be opened because the developer cannot be verified in OS X 10.15.2 and cannot be whitelisted.

42 views (last 30 days)
I have a MEX file and when I open it in OSX 10.15.2 Catalina, the system throws a message saying "cannot be opened because the developer cannot be verified".
It can only be opened while I disable Gatekeeper entirely. It does not work when I add the MEX files as exception using 'spctl --add'.
Is there any way I can whitelist the file without disabling Gatekeeper entirely?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Apr 2020
1. Check to see if the file is quarantined by running the following command in the terminal:
xattr /path/to/file
An entry “com.apple.quarantine” means the library has been quarantined
2. Remove this attribute by running the following command in the terminal:
sudo xattr -r -d com.apple.quarantine /path/to/file
3. Try to run the MEX file again

  1 Comment

Kunxun Qian
Kunxun Qian on 18 Apr 2020
Thanks! This solves my problem. Just to add that the
sudo xattr -r -d com.apple.quarantine /path/to/file
This line of code can also deal with a whole folder if you have more than one files need to overide the safety requirement.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2019b