Monday, May 01, 2017

Xamarin + Parallels for Mac

Well, it took the better half of a Saturday installing updates for what seems like everything, but I managed to my MacBook Pro running Visual Studio 2015 and able to deploy to the iPhone Simulator through the Xamarin Mac Agent. I was surprised at how easy it was and only one minor caveat I had to work through…

My Saturday began with starting my Windows 10 virtual machine on my Mac and being greeted with a warning regarding a conflict between Parallels for Mac 11 and the Windows 10 Creator’s Update. I hadn’t installed the Creators Update yet, so I decided there was no better time than the present to update my Parallels installation. The installation was quick and painless.

When I started my Windows 10 virtual machine, it was a bit unresponsive so I decided to restart it. However, my only options were to “Update and Shutdown” or “Update and Restart”. Sigh. Ok, let’s update this too.

Sure enough, the update was the Windows 10 Creators Update. Well, at least I updated Parallels first.

While I was waiting for this to complete, a notification from my Mac popped up: that update that required me to be connected to power didn’t run last night. It seems like my Mac has been nagging me for a while now to perform this update and I always choose “Later”. “Later” usually means the next day I’m warned about not being connected to a power source. Sigh. Ok, fine. I’m updating Windows, why not update the Mac?

Crap. That update was for Mac Sierra which I thought I had already installed. Maybe it’ll be quick. Wishful thinking for an OS update I suppose.

Both the Mac and Windows seemed to update around the same time, almost like they were in competition of completing before the other. Finally. Let’s do this.

When I booted up Visual Studio 2015 I was surprised that the usual Xamarin menu options weren’t available. I launched the Extensions and Updates option and realized that Visual Studio Update 2 wasn’t installed. I’d forgotten that I wasn’t using my Parallels for this (hence this post) and I’d been using my PC to do most of my builds and only using the Mac for the Xamarin Mac Agent. I started the Update 3 wizard and selected the 13 GBs of features that I needed. Let’s grab some lunch while this completes.

When I came back to my Mac, Visual Studio 2015 was already running and waiting for me. I launched the Xamarin Mac Agent and it immediately found my Mac. I logged in without issues. Brilliant. I decided to tempt fate and create a new Xamarin.Forms Portable application, compile and run on my iOS simulator. After creating the solution, Xamarin informed me that there was an update available. The rate things were going, I might as well do this now, right?

While I was updating the Xamarin NuGet package, I toggled back to my Mac and checked to see if there was an update for my Xamarin Studio. Yeah, I’m pretty sure you knew there’d be one too. Lots of downloads and updates.

OK FINE. Everything’s good now. Let’s compile this bad boy and try out deploying to my mac from Visual Studio.

Sadly, I was presented with a wack of compilation errors. Turns out, parts of my Xamarin.Android weren’t being resolved during compilation. The workaround appears in Xamarin’s troubleshooting section, so it must be somewhat common. I had to download a ~200Mb file, rename it and place it a specific folder and I was back in business. Compiling took 20 minutes while everything re-unpacked and initialized.

Everything compiles! Life is good. It’s about time we deploy to my mac from Visual Studio? Sweet Christmas, now it’s complaining that my version of Xamarin requires an update to XCode 8.3.

Fortunately, XCode 8.3 is only 2.5 GB and I must really want to compile and deploy. I fire-up Fantastic Beasts and where to find them while I wait.

About half way through the movie, I check out my Mac. I reboot and had to force a reboot on my windows 10 virtual machine.

I compiled. It worked. I clicked deploy. It worked. Hopefully the benefits of only having to carry around a single device provides enough productivity gains to outweigh this productivity disaster.

Oh – I mentioned a caveat. I wasn’t able to compile the solution using the default parallels mapped folder location \\Mac\\Home\\Documents. I changed this to a different folder on the machine.

Well, there you go. I think this post was more of a rant than any helpful tip. If you made it to the end, a cookie for you, I guess. Hope you enjoyed reading my adventure. Do you think Dumbledore will battle Grindlewald in the next movie?