Stardew Valley - How To Fix Your macOS Files - by Jaychalke

So, you’re trying to run “Install on macOS.command” script on your MacBook but get the following message/pop-up (or something similar preventing it from running):

This means that the script is not signed with an Apple-approved developer certificate. By default, macOS restricts running applications and scripts that aren’t signed by an Apple-registered developer to prevent malware execution. An Apple-approved developer certificate is a digital certificate issued by Apple to developers who register with the Apple Developer Program. This certificate allows developers to sign their applications, scripts, and executables, verifying their authenticity and ensuring macOS trusts them. This particular script does not appear to have this important certificate which is causing the issues you are seeing.

Let’s discuss a couple of options for fixing this.

-----------------------------------------------

------------------------------------------------------------------OPTION 1--------------------

----------------”OPEN ANYWAY”------------------

----------------------------------------------------------------------------------------------

        The first option is to select "OPEN ANYWAY," which allows macOS to override security settings and run the previously blocked script. You can do this by going to the Apple Icon  at the top left of your screen -----> System Settings ------> Privacy & Security:

From there, scroll down towards the bottom of the right-hand panel until you locate the following:

        If you notice in the above image, there is a text that states, “”install on macOS.command” was blocked from use because it is not from an identified developer.” with the option to “Open Anyway”. You would have needed to attempt to run the script for that to populate there. Click that “Open Anyway” box and it should populate the following box:

Once you’ve used your thumb or entered your password, it should populate the following box:

Note: This is not generally considered a best security practice, which is why multiple steps were required to get here. However, since we trust that this file is safe, you can proceed by selecting "Open."

As you can see, this was successful and you can now continue with the installation process as normal! ✅

Note: You will likely need to follow this step or one of the other methods covered in this tutorial for the StardewModdingAPI. Don't worry—I speak about SMAPI in this guide as well towards the end.)

-----------------------------------------------

------------------------------------------------------------------OPTION 2--------------------

-----------Add Files to Developer Tools--------

----------------------------------------------------------------------------------------------

If Option 1 didn’t work, the next step is to try adding the “Install on macOS.command” script to your Mac’s Developer Tools. You can do this by going to the Apple Icon  at the top left of your screen -----> System Settings ------> Privacy & Security:

From there, scroll down towards the bottom of the right-hand panel until you locate “Developer Tools” (located towards the bottom of the “Security” section just above “Sensitive Content Warning”).

You won’t have the files shown above just yet, but we’ll start by adding the “Install on macOS” script to your Developer Tools. There are two ways to do this: the first is by using the “+/-” button at the bottom left, or the easier method—simply drag and drop the files directly onto the Developer Tools page.

Open your Downloads folder and position both the Developer Tools window and the Downloads folder side by side. Then, simply drag the “Install on macOS” script from your Downloads folder into the Developer Tools window.

Before running the file, I decided to delete the “SMAPI 4.1.10” folder, which included the “install on macOS” script, and then re-extracted the archive. By unzipping the file again, we’ve created a fresh copy, allowing macOS to treat it as a new file—ideal for our testing.

As shown in the image above, the “install on macOS” script is currently toggled OFF, as indicated by the toggle button moved to the left.

As you can see by the pop-up we are familiar with from before, the script was blocked. Let’s toggle that option ON and try to run the script again.

This is quite intriguing! As many people have pointed out in the comments of my YouTube video, which you can find here: https://www.youtube.com/watch?v=zxIPkHHDK2k&lc=Ugw3XbeJUumpXB8YoTN4AaABAg

This solution didn’t work for them. What’s particularly interesting is that it worked for me in the video and successfully resolved the issue I was facing, however, did not work upon testing here for you! This is fine. We are going to move on to the next method!

-----------------------------------------------

------------------------------------------------------------------OPTION 3-------------------

-----Enable “Developer Mode” in Terminal-------

----------------------------------------------------------------------------------------------

Next, we are going to try and enable “Developer Mode” via the Terminal. Open up your Terminal. You can typically find this down in the “Dock” or you can do “Command + Spacebar” to open your “Spotlight Search” and type in “Terminal”.

Open “Terminal”, which should look something like this.

Next, you are going to want to type in the following command (you can copy and paste):

spctl developer-mode enable-terminal

(Press Enter)

This command enables Developer Mode for the Terminal. By default, macOS restricts certain actions for security, especially with untrusted software. The spctl (security policy control) command interacts with Gatekeeper, Apple's security feature that blocks potentially unsafe apps. Enabling Developer Mode for the Terminal should allow you to bypass certain security restrictions, which can help with running untrusted scripts or executables that would otherwise be blocked by Gatekeeper.

After entering the command, pressing Enter, and receiving the response "Terminal added as a developer tool", go ahead and restart your computer.

Alright, I'm back! Similar to the previous method, which worked for many of my commenters, it seems this one didn’t work for me either!

If it worked for you, GREAT! If not, let’s continue on to the next method.

-----------------------------------------------

------------------------------------------------------------------OPTION 4--------------------

Removing the quarantine flag from the “install ---------------on macOS” command---------------

----------------------------------------------------------------------------------------------

        For this option, you are going to need to get the “filepath” of the “install on macOS” script. There are various options to do this and I will show you all of them so you can maybe learn something! This option is going to require a bit more skill and ability to navigate the terminal but I am going to try my best to walk you through it. Assuming your “install on macOS” command is located in the “SMAPI 4.1.10 installer” folder within your “Downloads” folder, we’ll proceed with that information. If your “SMAPI 4.1.10 installer” is not in your “Downloads” folder, simply move it there and follow this tutorial, especially if you're not comfortable with the command line.

Open up your Terminal. You can typically find this down in the “Dock” or you can do “Command + Spacebar” to open your “Spotlight Search” and type in “Terminal”.

Open “Terminal”, which should look something like this.

Once you’ve opened the above you are going to want to navigate to your “SMAPI 4.1.10 installer” folder within your “Downloads” folder. I am going to take this slow for those who aren’t familiar with the command line. If you’re more experienced, feel free to utilize whatever method you find appropriate.

First, type the command:

ls

This command, “ls”, lists all the files and directories in your current working directory.

We are particularly interested in that “Downloads” folder. So, in order to move to that folder you will want to type the following command:

cd Downloads

This has now moved us into the “Downloads” directory. To confirm this type the command, “ls” again:

ls

I won’t show you all the files in my Downloads folder, but the one you will want to be sure you see is the “SMAPI 4.1.10 installer” we discussed earlier:

You are now going to “cd”, or “Change Directories”, into that folder:

cd “SMAPI 4.1.10 installer”

Note: When you try to use cd SMAPI 4.1.1.10 installer (without “”), Terminal interprets it as trying to change into two different folders: SMAPI and 4.1.1.10, with "installer" as an additional argument. The quotes around the folder name ("SMAPI 4.1.10 installer") tell the Terminal to treat the entire folder name as one argument, even with spaces in it. So, with that being said, make sure your command is exactly as displayed above:

Let’s look inside. You know what to do next!

ls

There it is! “Install on macOS” command. Next you will want to run:

pwd

pwd, or “Print Working Directory” is going to give you the working directory where you can find the file, which is:

/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/

This may look slightly different for you, especially where the name “zacharymccarter” appears. After that, add install on macOS.command (without quotation marks around it) at the end. However, be sure to enclose the entire path in quotation marks, like this:

“/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/install on macOS.command”

You now have your file path! BUT WAIT! There is an easier way of doing that. You can do this instead:

realpath “install on macOS.command”

The “realpath” command is used to obtain the absolute path of a specific file, which is necessary for the next step. However, before we dive into that, let's explore an even easier way to retrieve the file path.

If you drag the file onto your terminal window, it will automatically insert the full file path in the Terminal.

BUT WAIT! After pressing Enter, it looks like OPTION 3 actually worked when running scripts this way. So, if you followed OPTION 3, try dragging the script onto the Terminal window and pressing Enter. If it works—great! If not, we'll continue with this option.

Here is the example of me dragging the file onto my terminal to retrieve the file path but pressing enter and it running the script. This happened because we previously enabled Terminal as a developer tool using the “spctl developer-mode enable-terminal” command.

But let me save you all the hassle—here’s the simplest way to retrieve the file path of a specific file. Just right-click on the install on macOS script:

This will bring up the dropdown menu shown above, but we're not done yet. Once the menu appears, press and hold the Option key—this will change the Copy option to something new:

Copy “install on macOS.command” as Pathname

Select that, which will copy the filepath as we’ve seen it before. Pasting here, you can see that this is correct as shown above:

/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/install on macOS.command

So, all of that . . . what’s next?

xattr “/path/to/your/file”

The “xattr "/path/to/your/file"” command allows you to view the extended attributes of a file on macOS. We’ll use this command to check for a specific attribute, com.apple.quarantine, which indicates that the file was downloaded from the internet and is being flagged by macOS Gatekeeper. You are going to run the above command, except replace “/path/to/your/file” with the filepath we found earlier. So, mine would be:

xattr “/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/install on macOS.command”

Note: ADD “” surrounding the file path like shown above.

Excellent. This “com.apple.quarantine” is exactly what we are looking for.

        

To give a bit more detail to that attribute: The “com.apple.quarantine” attribute is a metadata flag that macOS applies to files that have been downloaded from the internet or transferred from an untrusted source. It’s part of macOS’s security measures to protect users from potentially harmful files, such as malware or applications that might not be verified. We are going to remove this.

xattr -d com.apple.quarantine “/path/to/your/file”

Or, in my case:

xattr -d com.apple.quarantine "/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/install on macOS.command"

The command ““xattr -d com.apple.quarantine "/path/to/your/file" is used to remove the “com.apple.quarantine” attribute from a file on macOS.The “-d” flag stands for delete, meaning it will remove a specific extended attribute from the file.

Run the command from previously to check to see if the flag is still there:

xattr “/Users/zacharymccarter/Downloads/SMAPI 4.1.10 installer/install on macOS.command”

Excellent. Now, let’s try to run the script by double clicking on it:

BOOM! We did it!

----------------------------------------------------------------------------------------------

-----------------StardewModdingAPI-------------

----------------------------------------------------------------------------------------------

Once you’ve successfully run the script, you will have new files/folders in your Stardew Valley folder. One file in particular that gives people issues is the “StardewModdingAPI”. For the StardewModdingAPI, you may have to follow the same steps above but for this file specifically. Let’s show you how to get to it easily. This becomes evident once you attempt to run Stardew Valley, which is now going to run the StardewModdingAPI in tandem to inject the mods that you have put in your “Mods” folder. If you get similar pop-ups as before, you know exactly what to do now!

First, you are going to want to open up Steam. From there, go to your Library. Right-click on Stardew Valley, select “Manage” and then “Browse local files”

 

From there, you are going to want to open up “Contents” and “macOS”

Once the “MacOS” folder is open, you are going to want to scroll down to towards the middle of the folder and locate the “StardewModdingAPI” file.

You will do the same things you did above but with this file.

ENJOY STARDEW VALLEY! 🙂

It randomly started to not work for me. So, i’m going to start adding notes here in no particular order for things that you can try.

               UPDATE #1:

Try this:

sudo xattr -r -d com.apple.quarantine "/Users/zacharymccarter/Library/Application Support/Steam/steamapps/common/Stardew Valley"

sudo chmod +x "/Users/zacharymccarter/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/StardewModdingAPI"

sudo spctl --add "/Users/zacharymccarter/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/StardewModdingAPI"

If macOS Gatekeeper is still flagging StardewModdingAPI as malware even after removing the quarantine flag and adding it to the Developer Tools, here are some additional troubleshooting steps to bypass the security restrictions.

Completely Disable Gatekeeper Temporarily

Since removing the quarantine flag didn’t work, you can temporarily disable Gatekeeper to allow SMAPI to run:

Step 1: Disable Gatekeeper

Run this command in Terminal:

sudo spctl --master-disable

Enter your Mac password when prompted. This completely disables macOS Gatekeeper.

Step 2: Try Running SMAPI Again

Open Stardew Valley and see if it runs.

If it works, proceed to Step 3 below.

Step 3: Re-enable Gatekeeper

Once SMAPI runs successfully, re-enable Gatekeeper for security:

sudo spctl --master-enable

-----------------------------------------------

If this guide helped you in any way, consider showing some love by subscribing to my YouTube and following me on my other social medias!

-----------------------------------------------

Twitch - jaychalke

TikTok - @jaychalkegaming

BlueSky - jaychalke.bsky.social

Lemon8 - @jaychalkegaming

Clapper - @jaychalkegaming

Instagram - @jaychalkeinsta

Threads - @jaychalkeinsta

Triller - @jaychalkegaming

Facebook - jaychalkegaming

-----------------------------------------------