Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

MacOS "Cannot open this application" fix.

A topic by BlueFalconHD created Jan 31, 2023 Views: 651 Replies: 6
Viewing posts 1 to 7
(-1)

I have found a fix for this problem.

Open `Terminal.app`, usually located in Applications/Utilities, then run the following command, assuming you downloaded the application to your downloads folder, and unzipped it, so you have the plain .app file (if not, replace ~/Downloads/ with the name of the directory you downloaded it to):

cd ~/Downloads/Digital\ Logic\ Sim/Contents/MacOS && chmod +x Digital\ Logic\ Sim && exit

The terminal window should close, and the app should now open.

For those who are curious, these commands: move into the directory where the app is ACTUALLY stored (being what should be executable), makes that file executable, meaning the system can run it, because for some reason it isn't by default, then exit.

Deleted post
(3 edits)

The only difference I see which could be causing the error are the file permissions as mentioned by BlueFalconHD

However execution doesn't seem to be the issue but rather the ACL flag.

"drwxr-xr-x" => version downloaded using itch app

vs

"drwxr-xr-x@" => version downloaded from chrome

xattr Digital\ Logic\ Sim.app => this returns com.apple.quarantine

The com.apple.quarantine extended attribute is a security feature in MacOS that helps prevent the spread of malware by marking downloaded files as potentially unsafe. When you download a file from the internet, MacOS sets the com.apple.quarantine attribute on the file to indicate that it was downloaded from the internet. This information is used by Gatekeeper, a security feature in MacOS, to determine whether the file should be allowed to run.

If your app is being blocked from running normally, it is likely because Gatekeeper is preventing it from executing due to the com.apple.quarantine attribute. To resolve this issue, you can remove the com.apple.quarantine attribute using the xattr command in Terminal: 

xattr -d com.apple.quarantine Digital\ Logic\ Sim.app 

After removing the com.apple.quarantine attribute, you should be able to run the app normally. However, keep in mind that this will disable the security feature provided by Gatekeeper, so it is important to only do this for apps from trusted sources.

My hypothesis was wrong and this doesn't work. Anyone have another idea?

For me the issue was the execute bit. The com.apple.quarantine attribute causes the "blabla is an app downloaded from the internet. Are you sure you want to open it?" and it also checks code signing, developer id and notarization etc. "Cannot open this application" is either a missing execute bit or the binary in the MacOS subfolder being for an architecture macOS does not support on your machine :-)

(1 edit)

When I try to launch the app normally, via the itch app, or via terminal command, the app just closes immediately and I get "Digital Logic Sim quit unexpectedly". If I manually go to digital logic sim.app -> view package contents -> Contents/MacOS and double click Digitial Logic Sim, terminal does launch, alongside the app for a second, but then I get "Segmentation fault: 11" in terminal, and again the app closes and I get an unexpected quit message.

> Open `Terminal.app`, usually located in Applications/Utilities, then run the following command, assuming you downloaded the application to your downloads folder, and unzipped it, so you have the plain .app file (if not, replace ~/Downloads/ with the name of the directory you downloaded it to):

> cd ~/Downloads/Digital\ Logic\ Sim/Contents/MacOS && chmod +x Digital\ Logic\ Sim && exit

> The terminal window should close, and the app should now open.

No absolutely not, this is not always a "fix it every time" solution.  Firstly, it really looks like you just copied a solution from someone else, as you clearly don't understand what this is doing, or there wouldn't be a "Secondly".

Secondly, no one should EVER run a command in terminal in MacOS or Linux/Unix environment and && an exit to it.  This isn't Windows, this is Linux/Unix.  You WANT to read the response for the command, even when its what you expect.  Because there is an off chance that the response isn't what you wanted, and now you'll have an actual error to use to find out why.  In the case of chmod, the only response you'll get, other than being prompted for your next command, WILL be an error.  Blindly exiting commands like this is how you get what's in one of the replies "No this didn't work and I don't know why", (blindly copying and pasting commands is also a way to get this, because chmod +x is not always going to make something executable to *you*, but whatever account level the terminal is currently at).

You need to edit your instructions: remove the `&& exit` from the commands (as a matter of fact, seperate the `cd Directory/to/executable` and `chmod` commands into multiple lines in the first place, because depending on the account level of the user, they may also need to elevate to an administrator/root level account to even run chmod in that directory), and either explain what you're doing here, or link to how you found out to do this so others following along can get the "why".


cd - simple, changes directory to whatever follows if the directory is valid, in this case home/Downloads/Digital\ Logic\ Sim/Contents/MacOS (note: \ is required because terminal emulators do NOT obey spaces as spaces, but as separators for commands/arguments)

chmod - CHanges the Mode of file operation between Read, Write and eXectution or a combination of the options.  use + to add the mode, and - to remove the mode.  Can use the format of +rwxrwxrwx (for all account levels, usually used with root), +[r][w][x] for current account level changes (where [] can be left out (but one of these must be present)) based on the account level of the current terminal window (not the account logged in to the OS !!), or in digit format, with +777 adding r, w, and x permissions to all accessible account levels.

exit - closes the terminal window

&& - requires a valid command (with arguments if necessary) on both the left and right side - will immediately run the command on the right once the command on the left has finished execution (and only then) as long as the terminal is not closed by that command.. it should not be used by lazy users/noobs just trying to save time, but by people who know what they are doing (knowing to type commands is not qualification, knowing what the commands DO and expected outcomes to look out for is also required) as the next command WILL happen even if the first one ends in an error state, as long as the first command is valid (i.e. if you cd into an invalid directory && pwd, pwd will still print the current directory after cd complains that no such directory exists)

Please Same issue as Bactobene I dont understand      also im macOS 10.13.6