I've got my Security preferences set to allow apps downloaded from "Mac App Store and identified developers." When I try to open an unsigned app:

open xyz.app

I see the following:

App can't be opened

Usually, I right-click on the app and click "Open". This brings up a similar dialogue, but this one includes an "open anyway"-type button:

App can't be opened, with open button

Is there a way to do this only using the open command -- something like:

open --even-if-unsigned xyz.app

2 Answers 2

  1. Create and add a Gatekeeper label to the app. (‘Approved’ is an arbitrary string.)

    spctl --add --label "Approved" /path/to/xyz.app
  2. Approve all apps with the label.

    spctl --enable --label "Approved"

    This only needs to be done once and adding the same named label to apps in the future automatically enables their access.

  3. Open the app as usual.

    open xyz.app

For more information about spctl (SecAssessment system policy security), see the man page.

  • 3
    Ah, a new addition to the list of things that I formerly only knew how to do GUI-ly, and now can do on the command line! Thanks!
    – LSpice
    Commented Jun 3, 2016 at 18:58

You could strip the quarantine from the app:

xattr -r -d com.apple.quarantine /path/to/xyz.app

You may want/need to use sudo for that command, depending on permissions.

Then Gatekeeper isn't involved, at all. Of course, that also means that the signature isn't verified, which removes an important safety feature.

  • I love this answer, too. It's a pity I can only pick one!
    – bonh
    Commented Jun 5, 2016 at 3:18
  • This worked for my manual installed OpenJDK installation. Thanks!
    – fachexot
    Commented Nov 29, 2019 at 13:01
  • 2
    On Catalina, this is the only answer that worked for me. Commented Sep 20, 2020 at 14:07
  • 1
    On Big Sur, this is the only one that worked for me as well. Commented Sep 15, 2021 at 7:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .