Windows MacOS Player build doesn't preserve execution flags

I tried to run the game on M1 on 2 Macs and it doesn’t work on Intel either. Tell me how to fix this?




Looking at the post tags (Windows Editor)
My first guest would be:

Note: If building a macOS application on Windows, you must set the executable flag for the binary before opening the application on macOS.

sudo chmod -R 755 APP-NAME.app ?
(probably chmod +x APP-NAME.app is enough? If you don’t want to go hardcore with permissions)

You might need to also change the flags on the actual binary inside the app bundle. It’s in the Contents/MacOS/ folder, usually with the same base name as the app.

1 Like

In my experience, you need to browse into the .app package (right-click on the application, choose “Show Package Contents”, then browse into Contents / MacOS and find the executable binary. Then perform your chmod +x on that file. Then right-click on the whole app bundle and choose “open,” which will be initially blocked, and then do it again. It’s quite a dance, and on macOS Sequoia you now also have to go into the System Settings / Privacy and Security tab to authorize each app you want to force open with your password.

If you want to skip the chmod bit, you can wrap the .app folder on Windows in an archive format like .tar before compressing or transporting it. This will preserve the executable properties of the bundle.

1 Like

So many difficulties. It’s easier for me to give up the build for MacOS.

I don’t have my MacBook to make changes to the compiled file on MacOS. Maybe there is a solution that can be configured in unity when I make a build?

I believe the execution flags get lost in transport (security measure?), even if .zipp’ed or .rar’ed, but not if you .tar compress it?

It should work if after building you don’t touch it, and just tarball it, and then upload/transport to users. (As Marbie said)

I’ll try in TAR

Maybe some archivers have settings for saving “flags”? Maybe you know?

The flags in question are a file system difference. You need to either archive with an archiving program which can change the bits and make a tarball (gzipped TGZ, of course), or do the building and packaging on macOS or Linux. Those two systems can build for all supported desktop systems, while Windows generally has issues with anything but its own file system.

If you want to get a proper automated workflow, it should be possible via scripted builds from the command line, running under WSL2. If somebody at Unity Technologies would write a handy step by step for it, that would be great :slight_smile: