xcsync is a .NET tool that enables developers to leverage Xcode for managing Apple specific files with .NET projects. The tool generates a temporary Xcode project from a .NET project and synchronizes changes to the Xcode files back to the .NET project.
Supported file types include:
Asset catalog
Plist
Storyboard
Xib
The tool has two commands: generate and sync. Use generate to create an Xcode project from a .NET project and sync to bring changes in the Xcode project back to the .NET project.
Note
This tool is only available for macOS due to the interactions with Xcode.
Install .NET xcsync globally with the following command:
dotnet tool install -g dotnet-xcsync
Usage
The .NET MAUI extension provides support for xcsync. Ensure you have the latest version. The xcsync commands in the .NET MAUI extension are only available when using Visual Studio Code on macOS.
Open the command palette (Cmd + Shift + P) and search for the .NET MAUI: xcsync - Generate an Xcode project and .NET MAUI: xcsync - Sync from an Xcode project commands.
Troubleshooting
To see details on errors related to xcsync, navigate to the Output window (CMD + Shift + u ) and select .NET MAUI - xcsync in the dropdown. If you are facing issues, please report an issue.
Provide feedback
Please check existing Known Issues before filing a new issue or suggestion.
Installation
Install .NET xcsync globally with the following command:
The project file to build. Supported project types are .NET MAUI projects or any .NET project that targets a supported platform (iOS, tvOS, macOS, MacCatalyst).
-tfm|--target-framework-moniker <FRAMEWORK>
Invoke the tool for a specific framework. The framework must be defined in the project file. Examples: net9.0-ios, net9.0-maccatalyst. Required if the .NET project supports multiple target frameworks (for example, a multi-targeted .NET MAUI project). If a single platform project, the default value will be the single target framework specified in the project file.
-t|--target <TARGET_XCODE_DIRECTORY>
The directory in which to place the generated Xcode project. Default value is (*_$(IntermediateOutputPath)_/xcsync*).
-f|--force
Forces the overwrite of an existing Xcode project. Default value is False.
-o|--open
Opens the generated project in Xcode. Default value is False.
-v|--verbosity <LEVEL>
Sets the verbosity level of the command. Allowed values are Detailed, Diagnostic, Minimal, Normal, Quiet. Default value is Normal.
-d|--dotnet-path <PATH>
Path to .NET SDK. Default value is path from parent process if it is dotnet, otherwise falls back to dotnet on PATH.
-h|--help
Shows help and usage information
Examples
Generate and open an Xcode project for a .NET MAUI project that uses the project file in the current directory, which supports the net9.0-iosTFM:
xcsync generate -tfm net9.0-ios
Generate and open an Xcode project for a .NET MAUI project that supports the net9.0-iosTFM:
Sync changes from a generated Xcode project in the default location ($(IntermediateOutputPath)/xcsync) back to a .NET MAUI project that supports the net9.0-iosTFM:
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.