Skip to content

Mac Catalyst (Early Preview)

Rolf Bjarne Kvinge edited this page Dec 18, 2020 · 8 revisions

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.

Pre-requisites

Getting Started

You can either start with an existing project (and add to it), or start with a new project (and edit the csproj).

Existing project

Existing test project: https://github.com/xamarin/xamarin-macios/tree/catalyst6/tests/common/TestProjects/MyCatalystApp

New project

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 be LSMinimumSystemVersion instead.

    • Also change the value to 10.15
  • Make sure you're building for iPad (or a Universal app /iPad + iPhone)

  • Remove the iPhone configuration [optional]

  • Search & Replace “iPhoneSimulator” → “MacCatalyst” [optional]

NuGet Restore

    msbuild /t:restore

Build

    msbuild path/to/myproj.csproj

Run

    open ./bin/MacCatalyst/Debug/*.app

Known issues

  • 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.
Clone this wiki locally