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.
Important
xcsync is currently in preview.
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.
Installation
Install the preview of .NET xcsync globally with the following command:
dotnet tool install dotnet-xcsync -g --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
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 drop-down. 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 the preview of .NET xcsync globally with the following command:
dotnet tool install dotnet-xcsync -g --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
Synopsis
xcsync generate [-p|--project <PROJECT>]
[-tfm|--target-framework-moniker <FRAMEWORK>]
[-t|--target <TARGET_XCODE_DIRECTORY>] [-f|--force]
[-o|--open] [-v|--verbosity <LEVEL>]
[-d|--dotnet-path <PATH>]
xcsync sync [-p|--project <PROJECT>]
[-tfm|--target-framework-moniker <FRAMEWORK>]
[-t|--target <TARGET_XCODE_DIRECTORY>] [-v|--verbosity <LEVEL>]
xcsync -h|--help
Options
-p|--project <PROJECT>
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-ios
TFM:
xcsync generate -tfm net9.0-ios
Generate and open an Xcode project for a .NET MAUI project that supports the net9.0-ios
TFM:
xcsync generate -p path/to/maui.csproj -tfm net9.0-ios
Sync changes from a generated Xcode project in the default location ($(IntermediateOutputPath)/xcsync) back to a .NET MAUI project that supports the net9.0-ios
TFM:
xcsync sync -p path/to/maui.csproj -tfm net9.0-ios
xcsync is open-source. For more information or to file an issue, please visit https://github.com/dotnet/xcsync.