How to create a MacOS Console App using VS on Windows - macos

.NET Core 3.1 Visual Studio 2019
I have created an iOS Xamarin mobile app, using Visual Studio running on Windows. All works fine, even debugging on an iPhone connected to the Mac on my network.
I now need a very simple Console App for the actual Mac (macOS computer). I have already written the Windows version of the Console App.
I cannot work out how to compile the Console App for macOS. Is it possible? Any help appreciated.

If it is not using Xamarin.Mac APIs, then you can "just" use the console app assembl(ies) and run it via dotnet
Or publish it via dotnet as a self-contained executable
dotnet publish --runtime osx.10.11-x64
Or a runtime-dependent cross-platform binary
dotnet publish
re: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
But if your app is using Xamarin.Mac APIs, then review my SO answer here:
re: Compile OSX app on Windows with Xamarin

Related

Compile OSX app on Windows with Xamarin

I have a Xamarin Mac app I've been handed to make some changes. I've got everything working correctly as far as Windows Visual Studio Xamarin connecting to Mac Xamarin -- the Mac ssh agent works and whatnot.
However, how do I compile the app? When I build it on Windows, it generates an .exe file. Is something supposed to be generated on the Mac side, too? Or do I take that .exe file and somehow package it into an OSX app?
I was trying to stay in my Windows environment to do the coding and building as much as possible.
Thank you.
You will need to compile/package/debug it on macOS.
The build process is performed locally on Windows, generating IL assemblies that cannot be used for running or debugging apps, and it doesn't create application bundles.
re: https://developer.xamarin.com/releases/vs/xamarin.vs_4/xamarin.vs_4.2/#Xamarin.Mac_minimum_support.
macOS Apps
Mac apps can be opened and compiled in Visual Studio to check for errors, however to debug or create a working executable the project must currently be built on a Mac. This limited support for Mac projects allows for easier code sharing in Visual Studio between iOS, Android, Windows, and Mac apps.
re: https://developer.xamarin.com/guides/cross-platform/windows/visual-studio/#macOS_Apps

Debugging Xamarin.iOS project without physical mac

My idea is to use macincloud to build xamarin project. And I'd like to debug it also.
On xamarin's site it's written that "Xamarin.iOS applications can be debugged with the built-in debugger in Xamarin Studio or Visual Studio." But it's still not clear if the device, for example iPad can be connected to Windows machine? Or It has to be connected to Mac only?
Device has to be connected to the Mac. If we are connecting to a mac remotely, we can use a Simulator and and view the result using a RDP client like TeamViewer. I'm not sure if that is possible with MainCloud. You can also go for Xamarin Test Cloud if that is feasible for you.
No, it's not possible to deploy to device and debug with MacinCloud. You can however launch a simulator and debug your app inside the emulator.
If you want to deploy to your ipad you can use publish your app with TestFlight service and install TestFlight builds on your iPad.
See more details at Developing iOS Apps in Visual Studio with MacinCloud
There are two possible ways how to do it. First one is more proper but it's in preview version - Microsoft introduced Xamarin Live Player.
Second way is to have your own virtual machine of macOS on Windows machine. Here is the tutorial how to do it.

Use Apache Cordova to develop OS X application

I'm wondering, if it's possible to develop an OS X application using Apache Cordova. There is only iOS mentioned on their site. But I'm currently evaluating a possibility to create a cross-platform app for Windows, OS X and than mobile platforms using Visual Studio.
Your suggestion will be highly appreciated.
Thanks
Currently, Visual Studio doesn't provide built-in support for Mac OS X development, using Cordova. However, when you use the Visual Studio Tools for Apache Cordova (Visual Studio TACO) you're really working with a standard Apache Cordova project. This means that you could use a project like the following which adds support for Mac OS X as a platform:
https://github.com/apache/cordova-osx
To use this, you'd need to work with the Cordova command line (e.g. npm install -g cordova) tools. You would install these tools, change into the directory for your Cordova project from Visual Studio, and then you should be able to follow the steps on that GitHub repo's readme. There are caveats for now - this solution only supports full-screen "kiosk" apps on Mac OS X, rather than building a fully integrated desktop app with features like a menu bar.

IOS Simulator or Run device visual studio 2015 apache cordova

Hello searched various sources on how to run my application on an iOS simulator or run the application on an iOS device by visual studio , but from what I understand I need to have a Mac.
main source:
VISUAL DOCS
Yes - that's correct. To build for iOS devices from Visual Studio, you do need to setup a Mac build server. You can either follow the instructions on the page that you linked to, or take a look at the steps on the same site to use a Cloud-hosted service, MacInCloud

How to deploy a Mono console app on Mac?

I wrote a C# console app using a new Console Project in Xamarin Studio. Now, how do I deploy it without requiring other users to manually install Mono on their machines? Ideally, I'd like to just distribute a binary executable (not using the Mac App Store).
You should use the mkbundle tool to include all dependencies within your binary. Scroll down to "Bundles" in the below link.
http://www.mono-project.com/Guide:Running_Mono_Applications

Resources