Search Unity

Issue opening Unity Mac applications on Mac Big Sur OS from Unidentified Developer

Discussion in 'macOS' started by 3DSim, Dec 22, 2020.

  1. 3DSim

    3DSim

    Joined:
    Sep 5, 2012
    Posts:
    5
    We are Windows PC Unity users and have built Mac applications for our Mac users for a number of years. Our Mac users have never had any issue opening the Mac builds we generated although sometimes they would have to change the security settings to give permission to open the Mac viewer from an Unidentified developer.

    However this security setting option appears to be absent in the latest Mac OS update call Big Sur, even though the advice on the Apple Technical Support page appears to say that Mac users can still open applications from unidentified developers;

    https://support.apple.com/en-ie/guide/mac-help/mh40616/mac

    Our clients have tried these instructions and still get an error message saying;
    "You do not have permission to open this application"
    Then advising them to contact their system administrators. System administrators have looked at this and cannot find a solution.

    Has anyone here had this problem and if so, how did you overcome it?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Generally when I make Mac builds from Windows, I need to do two things in order to be able to run it on a Mac (Catalina/Big Sur):

    1. Add executable bit to the executable:

    Code (csharp):
    1. chmod +x Game.app/Contents/MacOS/Game
    2. Remove quarantine attributes:

    Code (csharp):
    1. xattr -r -d com.apple.quarantine Game.app/
    The former is needed because Windows doesn't have the concept of executable bits so builds that are produced there lack it. The latter is needed because all downloaded files get this attribute put on them, and they won't be able to run until the attribute is removed.
     
  3. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    I'm experiencing a similar issue, but I can't seem to find a place to make those changes. What file exactly are you opening to add the executable bit and remove the quarantine attributes?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I'm not quite sure what you're asking? I'm executing those commands in the terminal app.
     
  5. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    Ah, I see. So there's no way to do this from a Windows PC?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    No, not at this point I'm afraid. We're investigating why the quarantine attribute removal is suddenly needed as of 2020.2, but marking the executable bit cannot be done on Windows filesystem because Windows has no concept of executable bits on its filesystem. You might be able to do chmod via WSL, though.
     
    GreenPandaStudios likes this.
  7. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    I tried it with Ubuntu, and no luck.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    chmod didn't work on Ubuntu?
     
  9. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    No, chmod worked, but the xattr command didn't have an -r switch. (I think that means recurse through the directory?).
    Anyway, someone trying to install my game on Big Sur had the same issue after I ran those commands on Ubuntu. It could be because I compressed the files afterward using file explorer though. Do you know if I would have to run compression from Ubuntu in order to maintain the executable bit data?
     
    Last edited: Jan 28, 2021
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yes, the file has to be on Linux partition/filesystem and has to be compressed by Linux software.
     
  11. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    I'll give that a try and get back to you, thanks!
     
  12. sherief055

    sherief055

    Joined:
    Jan 29, 2021
    Posts:
    1
    This video describes the procedure to solve this problem:-





    YOUTUBE VIDEO TO DESCRIBE THE PROCEDURE



    (SOLVED) "you do not have permission to open the application" only 3 steps to open apps on big sur
     
  13. GreenPandaStudios

    GreenPandaStudios

    Joined:
    Feb 4, 2020
    Posts:
    9
    Yeah, I really don't see the issue if you're already running macOS, you can just mess with the files in the terminal. But, with a windows machine, you need to somehow add the executable bits with a WSL and move the build off the PC without letting File Explorer touch it.
     
  14. Jon_Olive

    Jon_Olive

    Joined:
    Sep 26, 2017
    Posts:
    23
    I'm seeing builds done in 2020.2 on mac refuse to open in Big Sur - but rather than complaining about unknown developer - they say the app is damaged. Removing the quarantine flag fixes this. However - if someone is downloading the app - presumably BS will add the quarantine to the download - so how do you get an app to someone running BS without them having to do the remove quarantine thing?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    This is a known bug. See this: https://issuetracker.unity3d.com/issues/macos-builds-now-contain-a-quarantine-attribute
     
  16. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    Still getting this on 2020.3.0f1
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    What exactly are you seeing?
     
  18. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    I see this kind of message:

     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you run this command line on the app and copy paste the output?

    Code (csharp):
    1. codesign -vvv --deep /path/to/game.app
     
  20. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    The output:

    invalid Info.plist (plist or signature have been modified)
    In architecture: x86_64
     
  21. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    hmm that's weird. Are you (or anything in your project) modifying the info.plist file after Unity spits out the build?
     
  22. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you file a bug report? There must be some kind of corner case that we missed when fixing this bug.
     
  24. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    Bug report: (Case 1323501) macOS build reports as "Damaged" when downloaded from internet
     
    mrphilipjoel likes this.
  25. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Thanks I'll take a look.
     
  26. Jon_Olive

    Jon_Olive

    Joined:
    Sep 26, 2017
    Posts:
    23
    For what it's worth - 2020.3 .0f1 fixes it for me so far.
     
    Tautvydas-Zilys likes this.
  27. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Hey, I found a script in your project that modifies the built .app contents, which invalidates the signature Unity generates (named "BuildPostprocessor.cs"). Generally, my advice here would be to just resign the bundle but it seems like that doesn't work right now due to this issue: https://forum.unity.com/threads/codesign-fatal-error-2020-3-1f1-lib_burst_generated-bundle.1080743/

    Another issue is that we don't have .framework plugins correctly which you seem to have in your project.

    I'm trying to fix these two issues ASAP.
     
  28. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    Thank you Tautvydas
     
  29. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    You might still be able to work around this while waiting for the fix. I found that the issue I linked above regarding "code signature data out of place" depends on your luck. You may try just doing "codesign -s - -f --deep /path/to/game.app" and see if it happens to work.
     
  30. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
    Thank you for this workaround. Unfortunately this doesn't seem to work in this case:

    codesign -s - -f --deep /path/to/game.app

    game.app: replacing existing signature
    /Library/Developer/CommandLineTools/usr/bin/codesign_allocate: file not in an order that can be processed (code signature data out of place):
    /path/to/game.app/Contents/PlugIns/FileBrowser.bundle/Contents/MacOS/FileBrowser
    game.app: the codesign_allocate helper tool cannot be found or used
    In subcomponent: /path/to/game.app/Contents/PlugIns/FileBrowser.bundle
     
  31. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    An idea: since that is a plugin, copy FileBrowser.bundle from your Unity project into that directory in the built app bundle. That way you'd be able to resign it at the point before Unity messes it up.
     
  32. Creator-of-1BITDRAGON

    Creator-of-1BITDRAGON

    Joined:
    Jul 19, 2019
    Posts:
    17
  33. EzraHuffman

    EzraHuffman

    Joined:
    Jan 28, 2018
    Posts:
    2
    Thank you! This worked, just wanted to note that you do not need to remove quartine attributes for 2019, pretty sure they only added that in 2020 version.
     
  34. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    You're right about this. We have since fixed this in Unity 2020.3. I suggest upgrading to 2020.3.5f1 or newer!
     
  35. IdrilKalean

    IdrilKalean

    Joined:
    Dec 7, 2015
    Posts:
    9
    open terminal past "sudo chmod -R 755 " drag app on terminal and validate. type your password. launch (don't put in trash ;)) go security in setting and validate for open app.

    if always problem after this, go terminal (sometimes problem with quarantine too)

    "xattr -dr http://com.apple.quarantine " and drag the app and validate

    (this resole problem for all unity app not build with macOS with my MacBook Pro M1)
     
  36. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    340
    Hi, bumping this issue: is the Big Sur quarantine thing fixed when creating MacOS builds on 2020 LTS ? Are there plans to fix it also on 2019 LTS ? (we still use that version for some projects)
     
  37. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    It's fixed in 2020.3 and never existed in 2019.4.
     
  38. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    340
    Well I am not sure that I understand the problem correctly, then. I have built a macos app in Unity 2019.4.31 (on Windows), sent it to someone through transfernow.net to use on Big Sur, and he does have to go through the hassle of using command lines to fix it and run it.

    Am I missing something ?
    Is there a proper way to build it to prevent this problem ?

    If I understand correctly, I have two options:
    - build from mac (I am assuming I won't have the problem at all)
    - build from PC, send it to a mac, run the two command lines once. After that I can send the app to anyone and they won't have to go through the process to run it

    Is this correct ?
     
  39. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I suspect it's missing the executable bit, which doesn't exist on Windows filesystems. It's added through "chmod +x /path/to/game.app/Contents/MacOS/GameExeName" command line. If you're building on Windows, you can add it via WSL and zip/compress it to archive there. This has nothing to do with code signing, though.

    Quarantine attribute removal was only needed for 2020.3 before the code signing fix. It's not needed for 2019.4.