Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run MAUI app (From files generated from Windows -> VS2022) on MAC

Tags:

maui

In windows machine, from VS2022 17.1 preview, I have developed a sample MAUI app (Hello world application) and able to run it successfully in same windows machine. In bin -> debug -> windows related folder, I can also find an exe, which on clicking displays the hello world output as expected.

But I don't understand how to to deploy/run the same MAUI app on MAC from the files that were generated from my Windows machine -> VS2022? Files in the sense, we have bin->debug-> mac related folder -> files inside this. Can we use these files to deploy or run the application in MAC? So that we again need not use MAC for development of this HelloWorld application. If it is possible, please let us know how. If not, please suggest whether development in MAC is also required for running MAUI app in MAC?

like image 780
Lakshmi Narayana Avatar asked Oct 26 '25 04:10

Lakshmi Narayana


1 Answers

Not sure if you still need an answer. But as of 1/19/22 MAUI still does not have a method built into Visual Studio to deploy directly to a Mac. Tethering a Mac will only allow you to deploy to an iOS simulator or device attached to the Mac. But not deploy using Mac Catalyst. You have to do it manually. So here are the steps, as I recall.

  1. Set up your Mac with the latest XCode.
  2. Install Visual Studio for Mac.
  3. From Bash Terminal, Run Maui-Check on the Mac
  4. Port your entire Maui solution from your Windows machine to your Mac
  5. From Bash Terminal, go to the location of the project file
  6. Do a build of the project using the following command

dotnet build (projectname).csproj -t:Run -f net6.0-maccatalyst

-- replacing (projectname) with the name of your project. If successful, the app will automatically run. The app will reside in your project folder/bin/Debug/met6.0-maccatalyst/maccatalyst-x64/(projectname).app

It's a pain in the butt. But that's where we are today with MAUI.

like image 53
C Baer Avatar answered Oct 28 '25 18:10

C Baer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!