-
Notifications
You must be signed in to change notification settings - Fork 518
Mac Catalyst (Early Preview)
This guide is for super-early adopters to experience using Mac Catalyst to build iOS projects for running on macOS. This is unsupported.
For release plans, refer to the .NET roadmap.
- Install this package: xamarin.ios-14.9.0.153.pkg
- OR an alternative package with fixes for Xamarin.Forms: xamarin.ios-14.9.1.10.pkg (not signed nor notarized)
- Visual Studio Code - there is no IDE or debugging support
- Terminal
You can either start with an existing project (and add to it), or start with a new project (and edit the csproj).
Existing test project: https://github.com/xamarin/xamarin-macios/tree/catalyst6/tests/common/TestProjects/MyCatalystApp
Existing Xamarin.Forms test project: https://github.com/rolfbjarne/xamarin-macios/tree/b4d80b73294b5d50fbce24801450627a6a2368d2/tests/common/TestProjects/MyCatalystFormsApp (requires the pkg with Xamarin.Forms support from above)
Create a Xamarin.iOS project, and modify the csproj like this (in a text editor):
- Change the Import at the bottom to point to:
<Import Project="$(MSBuildExtensionsPath)\Xamarin\MacCatalyst\Xamarin.MacCatalyst.CSharp.targets" />
- Add a reference to Xamarin.MacCatalyst:
<Reference Include="Xamarin.MacCatalyst" />
The reference to Xamarin.iOS can stay (it will be necessary if using NuGets built for Xamarin.iOS)
-
Change the
MinimumOSVersion
key in the Info.plist to beLSMinimumSystemVersion
instead.- Also change the value to
10.15
- Also change the value to
-
Make sure you're building for iPad (or a Universal app /iPad + iPhone)
-
Remove the iPhone configuration [optional]
-
Search & Replace “iPhoneSimulator” → “MacCatalyst” [optional]
If you use Xamarin.Forms, you’ll have to add any references manually, like this (for example):
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="Xamarin.MacCatalyst" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
<Reference Include="Xamarin.Forms.Core">
<HintPath>$(PkgXamarin_Forms)/lib/Xamarin.iOS10/Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>$(PkgXamarin_Forms)/lib/Xamarin.iOS10/Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>$(PkgXamarin_Forms)/lib/Xamarin.iOS10/Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.1558-pre3" GeneratePathProperty="true" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
In most cases, you will also need to add:
<Reference Include="Xamarin.Forms.Platform">
<HintPath>$(PkgXamarin_Forms)/lib/Xamarin.iOS10/Xamarin.Forms.Platform.dll</HintPath>
</Reference>
msbuild /t:restore
msbuild path/to/myproj.csproj
open ./bin/MacCatalyst/Debug/*.app
- Xamarin.MacCatalyst projects won’t work in any IDE (so no debugging).
- The API surface of Xamarin.MacCatalyst.dll is not complete (no need to file issues about missing or wrong API). In particular there’s no support for any AppKit types.
- “nuget restore” doesn’t work. Use “msbuild /r” instead
- README
- xcode13.0 Binding Status
- xcode13.1 Binding Status
- xcode13.2 Binding Status
- xcode13.3 Binding Status
- xcode13.4 Binding Status
- xcode14.0 Binding Status
- xcode14.1 Binding Status
- xcode14.2 Binding Status
- xcode14.3 Binding Status
- xcode15.0 Binding Status
- xcode15.1 Binding Status
- xcode15.3 Binding Status
- xcode15.4 Binding Status
- xcode16.0 Binding Status
- xcode16.1 Binding Status
- xcode16.2 Binding Status