For older MacOSX, or if, as a developer, your Mac remembers your game build, a unity mac standalone build may open and run. But for newer MacOSX like Big Sur, Gatekeeper will prevent anyone else from opening your build and no matter of right clicking and checking system preferences will allow them to by pass Gatekeeper.
The Mac build can be made on a windows computer, but also remember if you zip the build on a windows a mac user may not be able to play after it is unzipped. Make sure it is zipped on a Mac computer to avoid this.
I followed and read multiple tutorials on how to get this working. But I still hit pitfalls which I would like to document here to avoid them later. Remember every mac build, no matter if it's the same game, needs to be notarized separately.
In case the links die, I'll add a point form list of requirements found across these tutorials:
This is the biggest pitfall, the entitlements are so annoying
THE REQUIREMENTS
Requirements:
Mac that is compatible with macOs 10.15 Catalina or later
My mac was just delegated to obsolete in 2020 (Macbook Pro 2012), but I still was able to install Catalina 10.15.7
Xcode 11.0 installed
Apple developer account with membership (~$100)
Apple ID account
Developer ID Application certificate from developer.apple.com and added to your Keychain on the mac
A generated password from appleid.apple.com (To my understanding: This is used to basically sign into your account through terminal without risking your actual password) Write it down, you will need it. If you need to reupload the zip or a new build, you need a NEW password
ProviderShortName should be Team ID found at developer.apple.com membership page
entitlements file
Now this file can be created in Xcode by making a new project Macos and selecting the plist project
save that as yourGameName.entitlements
then you can either add entitlements in that project or open it in a text editor and pasting in the entitlements you need
THE ENTITLEMENTS
This is the biggest pain in the ass.
The entitlements I needed (probably?)
Disable Library Validation
Disable Executable Memory Protection
set all to yes (will show true in the text)
--options runtime is required for notarization, Apple will email and say it failed if you skip this
The only way I got it to work is with this later on
--deep --force --verify --verbose --timestamp --options runtime
There are a lot of entitlements that may be required so some google foo might be the only option... Check here for info: https://developer.apple.com/documentation/bundleresources/entitlements
THE NOTARIZATION
Now, build your app or copy a non-zipped version to your mac.
I placed it in the Macintosh HD/Users/myname/ path because I'm lazy and bad with terminal code and I didn't want to have to type out the long /Uses/myname/Documents/etc./etc./ Path in the following terminal commands. You can get the terminal to select the desired path as well which I did not do.
I moved the entitlements file to the same path as well for the same reason.
signing is super important
In the terminal:
codesign --deep --force --verify --verbose --timestamp --options runtime --entitlements [/Path/nameOfEntitlementsFile.entitlements] --sign "[Developer ID Application: ()]" [/Path/ApplicationName.app]
to check if it worked:
codesign -dv --verbose=4 [/Path/ApplicationName.app]
but ALSO try to open the app on your mac. If it stops responding then your previous line didn't work with your entitlements. See entitlements section.
xcrun iTMSTransporter -m provider -u [appleid email] -p [generated password]
Upload the zip to apple servers
xcrun altool --notarize-app --username [you appleid email] --password [The generated password] --asc-provider [Team ID] --primary-bundle-id [com.YourCompany.YourGame] --file [/Path/TheZipYouJustMade.zip]
Wait for apple and RequestUUID will be in the terminal to check status. Use this line to check status:
xcrun altool --notarization-info [RequestUUID] -u [appleid email]
(input generated password when asked)
When apple emails to say it's successful, Staple:
xcrun stapler staple [/Path/yourGame.app]
Then zip again and use that to upload for standalone
SPECIAL THANKS
Thank you to Dr. Cheryl K. Olson who downloaded Cat Colony Crisis onto her Mac with Big Sur and patiently dealt with me as I struggled through this long and confusing journey. She's the author of Grand Theft Childhood which takes an unbias approach on video games and children.
https://www.grandtheftchildhood.com/GTC/Summary.html