Skip to content

Repository files navigation

UsbSerialForMacOS

BuildNuGet

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

  1. Add the NuGet package to your .NET 10+ Mac or Mac Catalyst project.
  2. Add following to Entitlements.plist
<key>com.apple.security.device.serial</key>
<true/>
  1. Use the UsbSerialManager class to enumerate and communicate with serial devices.
usingUsbSerialForMacOS;varmanager=newUsbSerialManager();varports=manager.AvailablePorts();if(ports.Length>0){boolopened=manager.Open(ports[0],115200);// Write/read as neededmanager.Close();}

Version Support

PlatformTarget FrameworkArchitecturesMinimum macOS Version
macOSnet10.0-macosx64, arm6415.0+
Mac Catalystnet10.0-maccatalystx64, arm6418.0+

.NET 10.0 or higher is required. Native libraries are included for both macOS and Mac Catalyst.

About

A .NET interop library for USB serial communication on macOS

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages