(Updated: )
/ #cli #terminal #mac 

Catalina "Apple cannot check for malicious software" Command Line Fix

Fix “X can’t be opened because Apple cannot check for malicious software” and “Developer or app can’t be verified” using the command line.

Mac OS X Catalina has introduced a new host of permission issues. There are workarounds for applications that you’re installing to your “Applications” folder, namely right-click and use the “Open” -> “Open Anyway” trick.

For developers among you, you will want to use the command line to fix this situation rather than clicking around the UI.

For the non-developers among you, some applications will fail to open even if you give them the correct system & security settings.

This post details how to do that using the command line (Terminal) and xattr -d com.apple.quarantine <path-to-program>.

Table of Contents

The manual permissions workaround

In order to open an application that “can’t be opened because Apple cannot check for malicious software” or “Developer or app can’t be verified”, we open Finder and go to Applications.

Find the relevant application and right-click it.

When the right-click menu opens, select & click “Open” and when the dialog opens, click “Open”.

Use the command line to fix “Apple cannot check for malicious software” and “Developer or app can’t be verified”

Your terminal application (I use iTerm but Mac OS comes with Terminal). Find the path of your application.

For applications in your “Applications” folder, that will be something like: /Applications/<app-name>.app.

Use xattr to delete the com.apple.quarantine attribute:

xattr -d com.apple.quarantine /Applications/<app-name>.app

You can then check that it’s been deleted using xattr’s default behaviour.

xattr /Applications/<app-name>.app

That’s how you can open applications for which “Apple cannot check for malicious software” or “Developer or app can’t be verified”.

Author

Hugo Di Francesco

Co-author of "Professional JavaScript", "Front-End Development Projects with Vue.js" with Packt, "The Jest Handbook" (self-published). Hugo runs the Code with Hugo website helping over 100,000 developers every month and holds an MEng in Mathematical Computation from University College London (UCL). He has used JavaScript extensively to create scalable and performant platforms at companies such as Canon, Elsevier and (currently) Eurostar.

Get The Jest Handbook (100 pages)

Take your JavaScript testing to the next level by learning the ins and outs of Jest, the top JavaScript testing library.