Wednesday, May 17, 2017

Running Xamarin.Forms application on an iPhone without using a Mac

By now, you should probably have heard of the latest news from Microsoft about the latest preview edition of Xamarin that allows you to test your Xamarin application on your iPhone without using a Mac. Note that this is only applicable for Xamarin.Forms application, not the Xamarin.iOS application, which still requires you to connect to a remote Mac in order to edit your Storyboard files. 

Getting the Preview Bits
First, you need to download Visual Studio 2017 Preview from https://www.visualstudio.com/vs/preview/

Once Visual Studio 2017 Preview is installed, install the Xamarin Updates Extension (https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/).

Once this is done, let’s create a new Cross Platform App (Xamarin.Forms) and name it as HelloWorld:


Select the Blank App template and click OK.
At the toolbar of Visual Studio 2017 Preview, click on the Live Player button:


You should now see a QR Code:


On your iPhone, download and install the Xamarin Live Player (https://itunes.apple.com/us/app/xamarin-live-player/id1228841832?ls=1&mt=8). Launch it and you should see the following:


Tap on the Pair to Visual Studio button and scan the QR code on your screen. It will now try to connect to Visual Studio:


Back in the original window that showed the QR code you will see the name of your iPhone connected:


When you ready to run the application on the iPhone, select the HelloWorld.iOS project in the toolbar of Visual Studio 2017. Click the Live Player button. At this moment, you will be asked to connect to a remote Mac. Ignore it. Instead, you should now see the name of your iPhone:


Click on the name of your iPhone and your application should now appear on your iPhone:

No comments: