I am not a mac user and started using VS 2019 mac 2 months a go. I have done all my Android releases using VS windows till today.
Release build+archiving takes more than 30mins every time using aot+llvm+bundle into native assemblies+full linking+ split into separate apks+proguard+dex
Yesterday i tried using VS 2019 mac latest Pre version.
Release build was like 2 mins
Installing on my samsung s10+ 5 mins
Archiving apks 10 mins (even maybe less)
Biggest surprise for me was my app size using windows 39mb, mac produced 25mb
App is running fine on my phone without any crash.
I havent tried latest VS2019 windows version yet. maybe same there now. I will try it also as soon as possible to compare.
if you did such big improvement congratulations
PS; my Windows machine is probably 2 times more powerful than my Macbook.
Answers
I use a Dell G5 (32GB Ram, 512GB SSD, i7) Windows 10, VS2017 latest version
My compiles are around 1min from clicking debug until it starts on my Samsung S9.
Do you have an SSD in your windows machine? If not, that is the difference.
@dooks i am talking about releases. otherwise debugging is fast on both windows and mac machines.
I have a brand new faster ssd on windows than mac ssd (6 years old).
@batmaci My release time is a bit longer, around 1m30s
But yeah, can't really compare a mac machine to your windows machine. All Apple hardware is done by Apple for Apple software. The latencies between RAM/GPU/CPU/HDD read/writes are much less than other machines. All optimized to work together. So Mac is faster with less numbers. As for the VS software differences, you'll have to install the 2019 version on your windows to see what have changed. It is great news that the final APK size is much smaller than older VS.
@Dooks i am always up to date with vs tools. I had tried vs 2019 windows before. it had some aot problem and it was taking even longer than vs2017. thats why i kept vs 2019 and vs 2017 side by side. Used 2019 mostly for debugging on windows because load times are faster than vs 2017 on windows.
last 2 months i started using vs 2019 mac and it had also a lot of problems. it was even behind vs 2019 windows releases. I created a ticket on their github to complain about it and i was advised to use preview channel on mac.
this made whole a lot of difference. i am surprised with the performance of vs mac even i am using 6-7 years old mac machine with less power than windows.
i am not sure if it was always like that. that vs mac been always faster than vs windows. I cannot confirm as i am new on mac also. But remember Xamaarin Studio being better than VS when they both exist until Microsoft acquired Xamarin. Then Xamarin studio was ported on Mac as VS Mac. while windows version is VS only. this could be the difference also.
1m,30s is extremely good time. you probably dont use settings i mention above or your app is relatively smaller than mine. AOT+LLVM+Bundle into native assemblies multiplies release time.
@batmaci I dont know what those settings are. Here are my Android settings for release. Debug is the same, just the
Enable Developer Intrumentation
is also ticked@Dooks you are using basic release settings. thats why your release is fast. You are probably on Community version. it doesnt have UI for those I mentioned but you still can use by changing android.csproj file. see following articles
https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows
https://xamarinhelp.com/xamarin-android-aot-works/
@batmaci No I have
VS 2017 Pro
But yes, I didn't compile with those 3 settings enabled.
Turned all of them on and tried to build. Doesn't build. Probably something else is wrong, but I'm fine with the way it is now and the final APK size. Planning on going native soon anyways, no more struggling with Xamarin.
Okay, almost when I gave Up - the settings were saved in the
CSProj
file (reverted for some reason) and it compiles successfully.4m30s
The Nuget Packages I use (including self binded libraries) in the project are :
With settings Enabled:
Without settings Enabled:
I do notice in the app with the settings enabled, it sometimes jerks a lot - I don't know if it is how the native compiled mono libraries act? It feels smoother in app without the settings, albeit a little longer startup time. Think the only way to get it as smooth as apps like WhatsApp would be to go native. Redo everything in Java. Things I'm missing in Xamarin are the disk cache libraries, latest updates of Google Libraries, the startup time is not good, the final APK sizes are not good, and speed difference in RecyclerView for example is not good at all. Xamarin is also always behind with new features such as the app bundling.
This was a nice experience, but luckily I could convince my Managers of a rewrite in Java.
Things I do like in C# - code re-usability, Actions, Events, SQLite library from
Frank A. Krueger
+ Linq & Lambda and the way objects are quickly built. C# Mono is very nice to develop in, but for a final product, not the best outcome.