These instructions will get you set up with the latest build of xcsync
from the main branch. If you just want the lastest preview release of .NET xcsync, see the README.md.
The latest builds are pushed to a special NuGet feed, which you need specify when installing the tool:
dotnet tool install dotnet-xcsync -g --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
The following section describes how to use the xcsync
tool to generate and sync an Xcode project with a .NET project. To start you will need to have either an existing .NET project or create a new one. Use the Create a new .NET project section to create a new project, otherwise jump to the Generate an Xcode Project from a .NET project.
Create an empty .NET MAUI project on the command line using one of the maui
, ios
, tvos
, maccatalyst
, or macos
templates:
dotnet new {template}
Replacing the {template}
placeholder with the template name.
The resulting project can be built using the following commands:
dotnet restore
dotnet build
Make sure your current directory contains your .NET project then run the xcsync
generate
command:
xcsync generate
By default the generated project will be located in the obj/xcode
folder of the project.
If you are testing on macOS then you can add the optional --open
argument to open the generated project in Xcode.
First follow the steps to generate the Xcode project above, then run the xcsync
sync
command:
xcsync sync
This will synchronize any changes made to the Xcode project back into the .NET project.