UsbSerialForMacOS 0.9.5
dotnet add package UsbSerialForMacOS --version 0.9.5
NuGet\Install-Package UsbSerialForMacOS -Version 0.9.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UsbSerialForMacOS" Version="0.9.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UsbSerialForMacOS" Version="0.9.5" />
<PackageReference Include="UsbSerialForMacOS" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UsbSerialForMacOS --version 0.9.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UsbSerialForMacOS, 0.9.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UsbSerialForMacOS@0.9.5
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UsbSerialForMacOS&version=0.9.5
#tool nuget:?package=UsbSerialForMacOS&version=0.9.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UsbSerialForMacOS
UsbSerialForMacOS is a .NET binding for a native Swift library that enables serial port communication on macOS and Mac Catalyst.
It allows .NET MAUI and .NET 10+ apps to enumerate, open, read from, and write to serial devices (such as USB-to-serial adapters and 3D printers) using a simple C# API.
Usage
- Add the NuGet package to your .NET 10+ Mac or Mac Catalyst project.
- Add following to Entitlements.plist
<key>com.apple.security.device.serial</key>
<true/>
- Use the
UsbSerialManagerclass to enumerate and communicate with serial devices.
using UsbSerialForMacOS;
var manager = new UsbSerialManager();
var ports = manager.AvailablePorts();
if (ports.Length > 0)
{
bool opened = manager.Open(ports[0], 115200);
// Write/read as needed
manager.Close();
}
Version Support
| Platform | Target Framework | Architectures | Minimum macOS Version |
|---|---|---|---|
| macOS | net10.0-macos | x64, arm64 | 15.0+ |
| Mac Catalyst | net10.0-maccatalyst | x64, arm64 | 18.0+ |
.NET 10.0 or higher is required. Native libraries are included for both macOS and Mac Catalyst.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-maccatalyst26.0 is compatible. net10.0-macos26.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0-maccatalyst26.0
- No dependencies.
-
net10.0-macos26.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.