PlayStation 5 Controller Support for Stardew Valley on MacOS
This covers both the PlayStation 5 DualSense controller as well as the PlayStation Edge DualSense Controller.
As of April 7 2024, the current stable version of Stardew Valley will not recognize PS5 controllers in Steam. The problem is that the SDL library (Simple DirectMedia Layer) is out-of-date. This means you will run into this issue up to and including Stardew Valleyโs 1.6 update (and likely further on).
The solution is to replace Stardew Valleyโs copy of libSDL with a newer version.
Note that the library weโre replacing will likely get overwritten every time Stardew Valley updates; you may need to run these steps with every update.
While Iโve tested this with a PlayStation DualSense Edge controller, chances are that this should work with any modern controller that doesnโt work for you like the XBox Series X or Nintendo Joycons. If either of these fixes work for you, please let me know and Iโll update this!
Option 1: Download A Pre-Built Versionโ
If you do not have XCode installed (and do not want to install it), then your only option is to download a pre-built binary from somewhere else.
I have compiled 2.28.5 (the last version of libSDL2) and provided it here.
- Download libSDL2-2.0.0.dylib and unzip it.
- Replace the original version with the version we just downloaded:
cp ~/Downloads/libSDL2-2.0.0.dylib ~/Library/Application\ Support/Steam/steamapps/common/Stardew\ Valley/Contents/MacOS/
- Run the file once to allow your computer to start it.
- Open Finder, press
Command + Shift + G
. Paste in~/Library/Application\ Support/Steam/steamapps/common/Stardew\ Valley/Contents/MacOS/
, then hitEnter
. - Find
libSDL2-2.0.0.dylib
, right-click and selectOpen
. You will be told that the file isnโt from a trustworthy source. clickOpen
. - A terminal window will open. As soon as it says
[Process completed]
, you can quit the terminal withCommand + Q
.
- Open Finder, press
Option 2: Compile libSDL2 Yourselfโ
- Download XCode from the App Store
- Close the libSDL repository:
git clone https://github.com/libsdl-org/SDL
cd SDL
- Switch to the 2.28.5 tag:
git checkout release-2.28.5
- Compile using the terminal:
mkdir -p build
cd build
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build .
- Because you compiled libSDL2 yourself, itโs already trusted by your computer. You just need to move it into place:
cp libSDL2-2.0.0.dylib ~/Library/Application\ Support/Steam/steamapps/common/Stardew\ Valley/Contents/MacOS/
- Verify compatibility version 2801.0.0 and current version 2801.5.0 are present:
otool -L ~/Library/Application\ Support/Steam/steamapps/common/Stardew\ Valley/Contents/MacOS/libSDL2-2.0.0.dylib | grep libSDL2
/Users/user/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/libSDL2-2.0.0.dylib (architecture x86_64):
@rpath/libSDL2-2.0.0.dylib (compatibility version 2801.0.0, current version 2801.5.0)
/Users/user/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/libSDL2-2.0.0.dylib (architecture arm64):
@rpath/libSDL2-2.0.0.dylib (compatibility version 2801.0.0, current version 2801.5.0)