Skip to content

Add MacOS support - #713

Merged
chompDev merged 2 commits into
sp-tarkov:developfrom
andrei-zgirvaci:feat/mac-support
Dec 21, 2025
Merged

Add MacOS support#713
chompDev merged 2 commits into
sp-tarkov:developfrom
andrei-zgirvaci:feat/mac-support

Conversation

@andrei-zgirvaci

@andrei-zgirvaci andrei-zgirvaci commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Disclaimer: I am not a .NET developer, so please excuse my lack of knowledge in this domain. There are probably more things to be added to this PR, so any guidance on the remaining changes will be very much appreciated!

Prerequisites:

  1. .NET 9 SDK: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.308-macos-arm64-installer / Homebrew
  2. Powershell: https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-macos?view=powershell-7.4#install-the-latest-stable-release-of-powershell / Homebrew

Build

In order to build the SPTarkov.Server MacOS native build locally, you can run the following command from the root directory (make sure to have my changes from this PR included):

dotnet publish SPTarkov.Server/SPTarkov.Server.csproj \
	-c Release \
	-f net9.0 \
	-r osx-arm64 \
	-p:IncludeNativeLibrariesForSelfExtract=true \
	-p:PublishSingleFile=false \
	--self-contained false \
	-p:SptBuildType=RELEASE \
	-p:SptVersion="4.0.8" \
	-p:SptBuildTime="$(date +%Y%m%d)" \
	-p:SptCommit="$(git rev-parse --short HEAD)" \
	-p:IsPublish=true

The above command was adapted from the build-sharp.yaml GitHub action.

Start server

You should now hopefully have the following directory generated: SPTarkov.Server/bin/Release/net9.0/osx-arm64/publish, if you do, you should be good to go!

cd ./SPTarkov.Server/bin/Release/net9.0/osx-arm64/publish

./SPT.Server.Mac

Happy playing!

Validation

✅ MacOS Server executable and it's dependencies are successfully compiled

game

✅ Server starts and runs natively on MacOS Tahoe 26.2.0 (check commit hash: "7830d62c")

game

game

✅ Game connects successfully to the server (check commit hash: "7830d62c")

game

✅ Full gameplay verified - raids, hideout, settings, etc.

Considerations

  • I would love to be able to run the server from a different laptop as I have a spare Mac and could offload some of the resources used for keeping the server alive. However, the game isn't able to connect to my other Mac's IP when specified in Launcher's Dev URL option. I am probably doing something, so some guidance will be much appreciated!

  • If you need me to open a PR also in https://github.com/sp-tarkov/build repo to configure the MacOS CI/CD builds, please let me know. I will be happy to contribute!

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Make launch profile path generic

To improve consistency and support for other architectures, update the
workingDirectory for the "Spt Server (Mac)" profile to be generic by removing
the hardcoded osx-arm64 path.

SPTarkov.Server/Properties/launchSettings.json [13-17]

 "Spt Server (Mac)": {
   "commandName": "Project",
   "hotReloadEnabled": false,
-  "workingDirectory": "bin/$(Configuration)/$(TargetFramework)/osx-arm64"
+  "workingDirectory": "bin/$(Configuration)/$(TargetFramework)"
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that the new "Spt Server (Mac)" profile hardcodes the osx-arm64 architecture in the workingDirectory, which is inconsistent with the existing "Spt Server (Linux)" profile and hinders support for other Mac architectures.

Low
  • More

@chompDev

Copy link
Copy Markdown
Contributor

Could you retarget the /develop branch please

@andrei-zgirvaci
andrei-zgirvaci changed the base branch from main to develop December 21, 2025 17:59
@andrei-zgirvaci

Copy link
Copy Markdown
Contributor Author

Could you retarget the /develop branch please

Sure! Done!

@chompDev
chompDev merged commit 2b1e628 into sp-tarkov:develop Dec 21, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants