Jump to content

Modding:Installing SMAPI on Mac: Difference between revisions

From Stardew Valley Wiki
imported>Pathoschild
imported>Pathoschild
m →Install from source: fix redundant command
Line 110: Line 110:


# build SMAPI
# build SMAPI
cd ~/SMAPI
./build/unix/prepare-install-package.sh 4.1.9
./build/unix/prepare-install-package.sh 4.1.9
</syntaxhighlight></li>
</syntaxhighlight></li>

Revision as of 22:44, 14 December 2024

This page explains how to install SMAPI (the tool which lets you use mods) on macOS.

See instructions for: Android • Linux • Steam Deck • Windows.

Install

Quick note: As of version 4.0.0, SMAPI uses NET 6.0, which is supported on Mac 10.15 (Catalina) or later. These instructions will fail if you're on Mac 10.12 (Sierra), Mac 10.13 (High Sierra), or 10.14 (Mohave), in which case, see: Modding:Player Guide/Troubleshooting#SMAPI doesn't work with the compatibility branch

  1. Download the latest version of SMAPI (see a pictorial guide).
  2. Extract the .zip file somewhere (but not in your game folder!).
  3. Right-click install on Mac.command and choose open. If you get a warning popup, proceed to the instructions outlined below in Troubleshooting.
  4. Follow the on-screen instructions.¹

That's it! Just launch the game to play with mods. You don't need to change your Steam launch options. (That's only needed on Windows).

¹To install manually instead, see instructions in the installer's readme.

Update

Just install the new version; the installer will automatically clean up previous versions.

Uninstall

  1. Launch the installer again (see install steps).
  2. When prompted, choose the uninstall option.

Troubleshooting

Warning message: "'install on macOS.command' Not Opened"

This message means that macOS blocked the installation because it cannot verify if SMAPI is safe. To bypass, you will need to manually approve in System Settings.

  1. Click on the "Done" button in the warning message.
  2. Open System Settings
  3. Navigate to "Privacy & Security" — scroll down until you find the "Security" section. You should have a notice that "'install on macOS.command' was blocked to protect your Mac." Click on the "Open Anyway" button.
  4. Another warning will pop up with the same statement. Click on the "Open Anyway" option, and you will be prompted to enter your password.
  5. Enter password and the installer should start running.

For a pictorial guide, see Modding:Installing_SMAPI_on_Mac_Pictorial_Guide#Install_SMAPI.

Error message: "Malware blocked and moved to trash"

This means macOS blocked SMAPI because it isn't signed with a paid Apple code signing certificate.

SMAPI does not contain malware. The error is due to new security restrictions on macOS that we're investigating. All new builds are detected as malware, even if they're identical to previously working versions. Note that all files on Nexus are scanned by 65 different antiviruses; you can click the green checkmarks on SMAPI's Nexus download page for the results.

Temporary workaround for affected players:

  1. Install SMAPI 4.1.7 instead. From the Files tab on Nexus, look under 'Optional files' for a download.
  2. From Spotlight, open the Terminal app.
  3. Enter this command for the Steam version of the game:
    codesign --force --sign - "Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/StardewModdingAPI"
    

    Or this one for the GOG version:

    codesign --force --sign - "/Applications/Stardew Valley.app/Contents/MacOS/StardewModdingAPI"
    
  4. Make sure both commands output nothing. If they show an error message, resolve the error or ask for help.

(This only 'signs' SMAPI so it can be played, it does not disable security or antivirus checks.)

Error message: "Operation not permitted: 'internal'"

To fix that error:

  1. Open System Preferences.
  2. Go to "Security and Privacy" and then the "Privacy" tab.
  3. Scroll down to "Full Disk Access".
  4. Click the lock button to make changes.
  5. Use the + button to add Terminal to the list of apps.
    • Try again to run install on MacOS.command.

Can't launch installer on Ventura

Common solutions:

  • Install iTerm and set it to be your default Terminal.
  • Or temporarily disable System Integrity Protection. This isn't a great solution because it leaves your computer vulnerable, and you absolutely shouldn't leave your computer in this state.

Other issues

Install from source

The macOS security may block SMAPI, since it's not signed with a paid Apple code certificate. If the troubleshooting sections above didn't work, you can compile SMAPI yourself to avoid the security restrictions.

The first time you do this, you'll need to install some pre-requisites:

  1. From Spotlight, open the Terminal app.
  2. Install Homebrew.
  3. Run these commands in Terminal:
    brew install git
    brew install --cask dotnet-sdk
    cd ~
    git clone -b stable https://github.com/Pathoschild/SMAPI.git
    

And then you can do this:

  1. Force-quit Steam.
  2. Run these commands in the Terminal app to fetch and build SMAPI:
    # fetch the latest SMAPI code
    cd ~/SMAPI
    git fetch
    git reset origin/stable --hard
    
    # build SMAPI
    ./build/unix/prepare-install-package.sh 4.1.9
    
  3. Make sure there are no red errors. (You can ignore yellow warnings.) If there are errors, come ask for help.
  4. When it finishes, the last line will say "Done! Package created in ...". You can unzip and run the installer in that folder to install SMAPI.