Setup .NET MAUI project on macOS
You may also be interested to know how Xamarin.Forms has grown and who will be its successor. I was interested too, so I took the time between the two holidays to test the .NET MAUI developed by Microsoft, so you’ll get a couple of articles about it. First, I’ll show you the installation and how I managed it under macOS.
It’s possible that by the time you read this post, you’ll be able to create a MAUI project from UI, but it’s not currently an available feature for me. However, a lot of the tutorials were outdated because .NET 6 with VisualStudio2022 has been released, and xCode 13 is not in beta either, so you can skip some unnecessary installations.
But what is definitely needed
- macOS capable device,
- Visual Studio 2022,
- xCode 13.
Get started on macOS
First thing first, fire up your macOS terminal, because we will start working in that.
If you havent installed Redth’s MAUI check tool yet, lets do this with the command
dotnet tool install -g redth.net.maui.check
Once it has been successfully installed, you will see the following output
You can invoke the tool using the following command: maui-check
Tool 'redth.net.maui.check' (version '0.10.0') was successfully installed.
So it says, that you can invoke the maui-check command from now on, but it’s a lie, since some things of ZSH terminal, we need to manually fresh up the terminals internal things, otherwise the maui-check command will fail with “Unknown command”.
export PATH=$HOME/.dotnet/tools:$PATH
From now on, you can freely invoke the
maui-check
Which results you the following output:
_ _ _____ _____ __ __ _ _ _ ___
| \ | | | ____| |_ _| | \/ | / \ | | | | |_ _|
| \| | | _| | | | |\/| | / _ \ | | | | | |
_ | |\ | | |___ | | | | | | / ___ \ | |_| | | |
(_) |_| \_| |_____| |_| |_| |_| /_/ \_\ \___/ |___|
π .NET MAUI Check v0.10.0.0 π
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This tool will attempt to evaluate your .NET MAUI development environment.
If problems are detected, this tool may offer the option to try and fix them for
you, or suggest a way to fix them yourself.
Thanks for choosing .NET MAUI!
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β³ Synchronizing configuration... ok
β³ Scheduling appointments... ok
It can fix a lot of things for you automatically, watch the output carefully, it prompts that you want to fix the issues or not.
To be honest, i don’t know this command will do the work any of the things above, but if you run this, after doing the things above, its also fine:
sudo dotnet workload install maui
Create a new MAUI project
Lets find a suitable place for our new project, then give out the following command:
dotnet new maui -n YourMauiProjectName
From now on, you can leave the terminal, and start editing the project in your favourite IDE, example the VS2022
Run your very first application
Since the projects are cannot be set as run projects in Visual Studio 2022 yet, we need to run our apps from the command line with this command
dotnet build YourMauiProjectName -t:Run -f net6.0-maccatalyst
This will run your app with mac Catalyst compilation, but you can create Android and iOS versions also with this command
4 Comments
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Hi, I am AndrΓ‘s,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.
[…] Setup .NET MAUI project on macOS (AndrΓ‘s TΓ³th) […]
[…] Setup .NET MAUI project on macOS [#MAUI #.net #.net 6 #.NET MAUI #macos #maui #visual studio #visual studio mac] […]
[…] If you are not familiar, how to set up your environment to start developing with .NET newest technology named MAUI, then read this article by me: https://www.banditoth.hu/2021/12/29/setup-net-maui-project-on-macos/ […]
Extremely Good ! Thanks a lot for working steps !