MacOsPublish 1.5.1
dotnet tool install --global MacOsPublish --version 1.5.1
dotnet new tool-manifest
dotnet tool install --local MacOsPublish --version 1.5.1
#tool dotnet:?package=MacOsPublish&version=1.5.1
nuke :add-package MacOsPublish --version 1.5.1
MacOsPublish
MacOsPublish is a command-line tool to build, bundle, codesign, and optionally notarize .NET macOS applications in a unified .app bundle that includes both x64 and arm64 binaries.
πΈοΈ Projet Web site
https://github.com/CastelloBrancoTecnologia/MacOsPublish
π¦ nuget package
https://www.nuget.org/packages/MacOsPublish
π οΈ Installation
To install MacOsPublish as a global .NET tool:
dotnet tool install --global MacOsPublish
Or update:
dotnet tool update --global MacOsPublish
You can also install it locally in your project:
OBS: If you cant run macospublish after installation please check if you path isnt configured
You can configure path if your shell is zsh with command like
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> ~/.zshrc
dotnet tool install MacOsPublish
To check if the tool is available:
macospublish --help
π§± Bundle Structure Generated
YourApp.app
βββ Contents
βββ MacOS
β βββ osx-arm64/ <- your arm64 build
β βββ osx-x64/ <- your x64 build
β βββ shared/ <- shared binaries (deduplicated)
β βββ YourApp.sh <- launcher script (auto-detects CPU arch)
βββ Resources/ <- assets (icons, images, etc.)
βββ Info.plist
βοΈ Usage
macospublish <PROJECT> [...options]
Arguments
| Argument | Description |
|-----------------------------------|---------------------------------------------------------------------------|
| <PROJECT> | Path to .csproj or .sln file. |
| --output <OUTPUT_DIR> | Destination output folder (default: bin/UniversalBundleApp). |
| --identity <IDENTITY> | Apple Developer identity. Empty to skip code signing. |
| --installer-identity <IDENTITY> | Apple Installer identity (used for .pkg generation). |
| --notarize <PROFILE> | Submit the .dmg to Apple Notary Service. Requires xcrun notarytool. |
| --plist-dir <path> | the directory of plist files (info/entitlements) if not in current dir.. | | --AssemblyVersion <version> | the version to put in AssemblyVersion. | |--dry-run | Dont Generate Any Files. | |-h, --help | Display help. | |--version` | Display version. |
π Notarization Setup
To notarize your app, first store your credentials:
xcrun notarytool store-credentials --apple-id <email> --team-id <TEAM_ID> --password <app-password> --keychain-profile "MacOsPublishProfile"
You can then use:
macospublish YourApp.csproj --notarize MacOsPublishProfile
π Example
macospublish MyApp.csproj publish/MyApp "Developer ID Application: Your Name (TEAMID)" "Developer ID Installer: Your Name (TEAMID)" --notarize MacOsPublishProfile
π§ Features
- β
Supports both
osx-arm64andosx-x64 - β Parallel builds
- β Deduplicates shared files (using SHA-256)
- β
Creates
.app,.pkg, and.dmg - β Optional Apple notarization and stapling
- β Symbolic links to shared files
- β
.DS_Storecleanup - β Automatic architecture launcher script
π¦ Requirements
- .NET SDK
- macOS with:
xcruncodesignproductbuildhdiutil
π License
MIT License β (C) 2025 Castello Branco Technologia LTDA
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.1 | 326 | 3/14/2025 |
| 1.5.0 | 199 | 3/14/2025 |
| 1.2.5 | 211 | 3/13/2025 |
| 1.2.2 | 204 | 3/13/2025 |
| 1.2.1 | 215 | 3/13/2025 |
| 1.2.0 | 208 | 3/13/2025 |
| 1.1.4 | 201 | 3/13/2025 |
| 1.1.3 | 211 | 3/13/2025 |
| 1.1.2 | 198 | 3/13/2025 |
| 1.1.1 | 207 | 3/13/2025 |
| 1.1.0 | 212 | 3/13/2025 |
| 1.0.5 | 211 | 3/12/2025 |
| 1.0.2 | 209 | 3/12/2025 |
| 1.0.0 | 235 | 3/11/2025 |