From 51d116601428b8c56a2f707447d6852390882859 Mon Sep 17 00:00:00 2001 From: The Werewolf Date: Wed, 17 May 2023 20:47:16 -0700 Subject: [PATCH 1/2] Update macos-development.md It took me two weeks and a lot of painful floundering around to realise this is how you take an AvalonUI app project and run it on MacOS because I've also been looking at Uno.Platform, OpenSilver and Xamarin.Forms. These 10 or so sentences would have saved me SO much time and frustration. --- guides/developer-guides/macos-development.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/guides/developer-guides/macos-development.md b/guides/developer-guides/macos-development.md index 31d2c73..d39f187 100644 --- a/guides/developer-guides/macos-development.md +++ b/guides/developer-guides/macos-development.md @@ -4,6 +4,22 @@ description: Getting started developing for the macOS backend # macOS Development +## How to build and run your AvaloniaUI app for macOS + +It's actually really simple. If you're developing in Windows (which is easier for a Windows developer), once your AvaloniaUI application is looking about right and you're ready to try it on macOS, copy your entire project folder to your Mac (don't worry - all the files will be treated as basic flat files). If you have a github for it, commit it and then check it out on your dev Mac machine. + +You'll need Visual Studio for MacOS. + +Open your project's SLN file in Visual Studio for MacOS. + +Then run. + +That's it. + +VS for Mac will recompile the code and since it's target independent, it will build the native (ie: Mac) version and link all the Mac target DLLs for .Net Core 6.0 and AvaloniaUI. + +The following instructions are for more advanced builds such as having a proper Mac app bundle or of you need better intergration with native MacOS. + ## Native code The native macOS code is located at `native/Avalonia.Native/src/OSX`. Open the `Avalonia.Native.OSX.xcodeproj` project in Xcode. From f37b81b8574bf62965491e940f410a17064867d8 Mon Sep 17 00:00:00 2001 From: The Werewolf Date: Thu, 18 May 2023 17:51:22 -0700 Subject: [PATCH 2/2] Update macos-development.md Added more details for JetBrains Rider and CLI users --- guides/developer-guides/macos-development.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/guides/developer-guides/macos-development.md b/guides/developer-guides/macos-development.md index d39f187..63846c0 100644 --- a/guides/developer-guides/macos-development.md +++ b/guides/developer-guides/macos-development.md @@ -8,15 +8,24 @@ description: Getting started developing for the macOS backend It's actually really simple. If you're developing in Windows (which is easier for a Windows developer), once your AvaloniaUI application is looking about right and you're ready to try it on macOS, copy your entire project folder to your Mac (don't worry - all the files will be treated as basic flat files). If you have a github for it, commit it and then check it out on your dev Mac machine. -You'll need Visual Studio for MacOS. +You'll need a development platform for macOS such as Visual Studio for MacOS, JetBrains Rider or you can build from the command line if you have the dotnet SDK installed on you Mac. +See the Getting Started>>IDE Support for more details. -Open your project's SLN file in Visual Studio for MacOS. +### Visual Studio for Mac or JetBrains Rider +Open your project's SLN file in your platform of choice -Then run. +Then build or run. -That's it. +### Command Line Build +Open Terminal and change directories (cd) to your project's folder (where the project's sln file is). -VS for Mac will recompile the code and since it's target independent, it will build the native (ie: Mac) version and link all the Mac target DLLs for .Net Core 6.0 and AvaloniaUI. +Type "dotnet build" to build your project. + +If you have multiple SLNs in the same folder, you will have to specify which one to use by typing "dotnet build myproject.sln" where "myproject" is the name of your SLN. + +To run either type "dotnet run --project pathToProject/myproject.csproj" where "pathToProject" is the path to where the csproj file you want to run is, or change directories (cd) to that location and type "dotnet run". + +Your build platform will recompile the code and since it's target independent, it will build the native (ie: Mac) version and link all the Mac target DLLs for .Net Core 6.0 and AvaloniaUI. The following instructions are for more advanced builds such as having a proper Mac app bundle or of you need better intergration with native MacOS.