.NET MAUI on Mac

Wednesday, June 1, 2022

Up to now we’ve installed .NET MAUI on Windows and got the Android emulator running. .NET MAUI’s brilliance is that it is Multi-platform. That doesn’t mean just Windows and Android. We can target Mac Catalyst and iOS too. Let’s look at how that is setup.

First, download the Visual Studio 2022 for Mac Preview. Find it in your Downloads folder and run it. Once it starts up make sure to check the Core and CrossPlatform options.

Visual Studio 2022 for Mac Preview InstallerVisual Studio 2022 for Mac Preview Installer

Click the Install button and wait for it to download and install. Next select the shortcuts that you want to utilize. I’m going all in on the Mac and am going to learn the Visual Studio for Mac keybindings. Although I’ll probably switch in the Preferences later.

Visual Studio shortcut selection screenVisual Studio shortcut selection screen

You may be asked to log in with your Microsoft Account. After that you’ll find this screen.

Visual Studio 2022 for Mac PreviewVisual Studio 2022 for Mac Preview

Now let’s create a quick application to show that it works. Click the + New button and the template selection screen will open up.

Visual Studio template selectionVisual Studio template selection

Select Multiplatform and App from the left then select .NET MAUI App on the right. Then click the Continue button. Give the project a name like “MyFirstMAUIApp”. Make sure the location is okay and click the Create button. We’ll use git in the future when we expand on the To-Do app we started on Windows. If all went well you should see the code as below.

Demo app in Visual StudioDemo app in Visual Studio

Click the play button in the top left corner and the app will spin up. If you get an error that the Apple SDK cannot be found go into Preferences from the Visual Studio menu select Apple from the SDK Locations option and change the Apple SDK Location to /Applications/Xcode.app and restart Visual Studio 2022 for Mac Preview. (You do have XCode installed right?)

Demo app running on MacDemo app running on Mac

You can change the device by clicking on where it says My Mac next to Debug (the Debug next to the Play button) and select an iPhone or iPad device to run it on. Here it is running on an iPhone 12 simulator.

Demo app running on an iPhone 12 Pro simulator

You are all set to continue development with .NET MAUI. Let me know how it goes for you.

.NET MAUIMac

This work is licensed under CC BY-NC-SA 4.0

.NET MAUI Main Page

.NET MAUI Android Setup