How to Build and Compile Cross Platform Xamarin Apps on Linux

Can you develop Linux applications with Xamarin?

Just in case someone else comes accross this q/a: the situation has changed. With Xamarin.Forms 3.0, Gtk# is supported (as preview, at this moment). Therefore, full Linux GUI support is enabled.

So, Xamarin now covers:

  • Android
  • iOS
  • UWP apps
  • WPF apps
  • Linux Gtk desktop applications
  • Mac OS
  • Watch OS
  • tv OS
  • Tizen

The only thing left to wish for: JS/HTML5 Web App target platform, as part of Xamarin :)

Can xamarin apps be built for Windows, MacOS with same source code?

Xamarin.Forms is the framework that allows you to create cross-platform apps between Android, iOS and UWP. In my experience, a lot of the features of Xamarin.Forms do not transfer over to Xamarin.Android. In fact, a big chunk of the way things are done for UI Xamarin.Forms will not transfer over to the Xamarin.iOS and Xamarin.Android. Most of the times when I find a solution that works in Xamarin.Forms and I try to do the same thing in Xamarin.Android I end up just figuring out the problem myself in Xamarin.Android from scratch.

When they say that 90% is shared, they mean that within Xamarin.Forms... 90% of the work on your models and code behind can be shared between the projects (within that Xamarin.Forms solution) and 10% will have to be custom tailored for each platform (UWP, Android, iOS)

EDIT: Just for clarification in the future, you need an iOS device or an iOS virtual machine to compile the code on iOS

To build Xamarin.iOS apps with Visual Studio 2019 on Windows, you will
need:

A Windows machine with Visual Studio 2019 installed. 

This can be a physical or a virtual machine.
Windows system requirements

A network-accessible Mac set up with Apple's build tools and Xamarin.iOS.

Visual Studio 2019 accesses this machine over a network
connection to use Apple's build tools, which are required for
compiling native iOS applications.
Mac system requirements

source: https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/?pivots=windows

No resource found... trying to compile a blank cross-platform Xamarin app

Navigate to:

C:\Users\username\AppData\Local\Xamarin\zips

Locate this zip file:

2A3A8A6D6826EF6CC653030E7D695C41.zip

Now delete this file, then go back to Visual Studio and Rebuild Solution.. will take some time to fully download the file depending on your connection speed, it's around 200mb.

Is it possible to compile a C# program from Visual Studio for running on Mac?

Try to run the exe in Mac by using mono:

/Library/Frameworks/Mono.framework/Versions/Current/bin/mono --runtime=v4.0 [path-to-your-exe]


Related Topics



Leave a reply



Submit