Failure digitally signing a Mac app outside Xcode

后端 未结 5 2055
花落未央
花落未央 2020-12-08 05:57

I develop a Mac app with Qt5, so outside Xcode. I want GateKeeper to allow my app to run on clients\' computers rather than issuing the \"Can\'t be opened because the identi

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 06:16

    My two bits:

    1. To really verify codesigning, I had to either upload my DMG to a server and download it using a browser or set the quarantine attribute manually:

      APP_PATH="Any.app"
      xattr -w com.apple.quarantine '0081;5a37dc6a;Google Chrome;F15F7E1C-F894-4B7D-91B4-E110D11C4858' "$APP_PATH"
      xattr -l "$APP_PATH" # You should see the quarantine attribute here
      open "$APP_PATH"
      

      If your app is correctly signed, you should see a system dialog with an "Open" button.

      I found the value of the quarantine attribute by looking at another .app downloaded from the internet. I don't know what the value means.

      I don't really understand why the spctl command says "accepted" even if the Gatekeeper service denies opening the app.

    2. I had the "unidentified developer" message box because my Qt frameworks were referenced as "@rpath/QtCore.framework". Changing it to "@application_path/../Frameworks/QtCore.framework" using the install_name_tool fixed the issue in my app.

提交回复
热议问题