Mac Unity Build (from a PC) not opening on Mac

I made the Build for my project for both PC and Mac, however I had massive issues getting the Mac one to actually work. Here is the tutorial I used to make the builds which was suppppper helpful, but it didn’t help fix my issue:

I just figured out how to make the Mac build work with a friend and it was a bit of work. Once you follow the video’s directions exactly for the Mac version, you can send the file to your Mac but when you do it will be labeled MacOS and then when you try to open it it will most likely fail and say missing application to open.

From what I have learned from numerous threads (and I don’t know how true this is, this is based off of other users), this is because the compression actually corrupts the executable file to open it on the Mac.


EDIT

The comments made it clear to me that "this has nothing to do with compression or even corruption. All files taken from a Windows machine will have default permissions, which are read/write. To launch something, you need to mark the executable with execute permission.

This problem doesn’t exist if you build from Mac or Linux editor."

However, the following information did allow my Mac Build to run after the compression.


To fix this, you have to use Terminal to navigate your way into the file and unlock the permission settings that were changed due what we believe is from the compression.

I honestly can’t remember where I found this code and when I remember I’ll be sure to credit them, but with terminal you need to navigate to the download folder (or wherever you put your app) and add the following:

cd <PATH_TO_YOUR_APP>/<APP_NAME>.app/Contents/MacOS/

and add the following:

chmod -R 777 [applicationName].app

This unlocked the permissions on the application but when the app was opened, we had to allow permission through the Mac firewall to let it run on the computer. Once we approved permission, the app ran no problem.

I hope this helps and I’m by no means a professional with this so but my friend and I can try to help in anyway possible.

5 Likes

I don’t think that has anything to do with compression. Windows simply does not have the concept of Unix file permissions, nor any way to represent them.

Truthfully I have no idea either, I’m only reiterating / compiling all the research I found from numerous threads but I’ll specify that better

Yeah this has nothing to do with compression or even corruption. All files taken from a Windows machine will have default permissions, which are read/write. To launch something, you need to mark the executable with execute permission.

This problem doesn’t exist if you build from Mac or Linux editor.

4 Likes

Do you know how to mark the executable prior to sending it from a PC? None of this information came up in my research and using Terminal afterwards was the only solution that worked.

Thanks for also pointing out that it’s not to do with compression.

If you could do it on the PC, Unity would be doing it for you. The point is that you can’t set the executable bit in Windows, because the Windows file system has no way to represent that.

Though I suppose Unity could, in theory, spit out a Mac disk image, containing your app with all the bits set correctly… but there are probably technical reasons why that is very hard to do.

1 Like

well, so in reality it means, I can not build a mac build from windows so my friends can test it.
Thats not very comfortable nowadays.
Would it not made sense for unity to add a fixed Script with the build with also a readme how to do it ?

Peter

2 Likes

On Windows 10 you have the option to run WSL Windows Subsystem for Linux.
Using WSL you can access your Windows file system from a linux command prompt, and use chmod etc to set file permissions.

5 Likes

I really can’t believe that there isn’t some sort of fix, be it from Unity, Microsoft, or Apple.

it seems absolutely insane to me that in 2021 this could still be an issue, it’s not like we’re talking about someone’s personal rpg maker game or something, we’re talking about an industry standard tool.

I feel like with something as big as unity these companies would work together to find a way to seamlessly build for all supported build platforms.

It really feels lazy to me.

I understand that windows can’t natively set the permissions, but I don’t believe for a second that they couldn’t implement something, nor do I believe that Unity is incapable of implementing some sort of fix, and if absolutely nothing else Apple certainly would be able to do it, considering it’s running natively on their platform.

As simple as it is to fix it’s absolutely absurd to make end users go through this process. I don’t expect users to pay for a game and then modify it just to make it work, no matter how simple that modification may be.

Unity needs to reach out to Microsoft and Apple so that this can be seamless.

4 Likes

The problem I had:

  1. Make mac build on windows with Unity 2020.2.X
  2. Put on google drive and share
  3. Download the build on Mac
  4. Show it’s damaged and can’t open

Solution:

  1. Open Terminal
  2. cd to the *.app folder
  3. xattr -rc *.app
  4. Double-click, it opens
4 Likes

We’re actually fixing this! https://issuetracker.unity3d.com/issues/macos-builds-now-contain-a-quarantine-attribute

1 Like

I use 2020.3.0f1 and the BUG is NOT FIXED.

4 Likes

Can you elaborate? The fix landed and has fixed the issue in all cases we could think of to test.

i dont have chmod on my cmd

its still an issue. my permissions are full control and still mac users cant run the app

What is the error you’re seeing? Can you show a screenshot?

I would like to note that the issue being discussed here is NOT the issue described in that ticket, which is why so many on this thread (me included) and in the comments on the ticket are saying it’s not resolved.

Issue in this thread is Unix file permissions. Windows Unity Editor makes a Mac build; Windows doesn’t have file permissions like macOS does; so the files don’t have the “execute” bit set; so when opened on a Mac, it is not allowed to execute.

Issue in the ticket, which is the one resolved in 2020.3.x, is codesigning, which is how Apple tries to keep riffraff from running executables rampantly on maxOS.

It may be that these issues were confused with each other and a ticket for the file permissions bug has never actually existed, and if so that definitely should be created, because Mac builds built with the Unity editor still are not runnable.

9 Likes

Any plans to back fix this bug into 2019.4 LFS? It’s causing us issues as well.

https://issuetracker.unity3d.com/issues/macos-builds-now-contain-a-quarantine-attribute was never introduced into 2019.4. Are you sure you’re running into the same issue?

Facing this issue on 2019.4.22f1 worked for other test macs but not on “macOS Big Sur v11.2.3”

1 Like