Freigeben über


Setting up Xamarin Live Player

[UPDATE]

You no longer need the preview version of Visual Studio. Updated directions can be found in the  Xamarin documentation

[ORIGINAL] Xamarin Live Player is a new tool that allows you to live edit an application running on an Android or iOS device. The interesting bit for many, is that you don’t need a Mac to have this work with your iPhone. The Xamarin Live Player app executes your code for you so that you don’t need to deploy it to the device – you just connect the Xamarin Live Player app to Visual Studio.

The official setup instructions are in the Xamarin documentation but I thought I’d go into a little more detail.

The short version is this

  1. Install Visual Studio 2017 preview 15.3
  2. Install the Xamarin Updater extension
  3. Update the Xamarin for Visual Studio extension
  4. Install on Xamarin Live Player on your phone

The long version:

First install Visual Studio 2017 preview 15.3. The preview can be downloaded at https://www.visualstudio.com/vs/preview/ I am installing the community edition of the preview, but I already have the released Enterprise Edition on my laptop. That is fine because the previews will install side by side with the release editions of Visual Studio. In addition, it will share components with the release version where it can which will reduce its storage requirements on your hard drive.

At the website, select the Download button, then select the edition of the preview you want to install.

capture20170512082746784.

The Visual Studio Installer may need to update itself to include the preview options so click update.

capture20170512083929462

When that is done, ensure you have the Mobile development with .NET selected. In my case I also deselected all the optional items on the right to speed up the install.

capture20170512084127114

Click install and wait for it to finish.

capture20170512084214318

When it does, you should have the preview listed alongside any other edition of Visual Studio you already had installed.

capture20170512085400940

Now that it is installed you will also see it in the start menu listed as “Visual Studio 2017 Preview (2)”

capture20170512085649750

When you launch it you will be able to tell it is the preview version by the preview flag in the title bar of the window

capture20170512085728421

Open the extension manager (from the menu Tools->Extensions and Updates) and search for Xamarin in the Online tab. You should see Xamarin Updater among the items. Click the Download button and the close the dialog.

snip_20170512150456

You may notice it doesn’t install immediately. This extension can’t be installed while Visual Studio is running. Close Visual Studio and the installer will launch.

capture20170512085837317

Click Modify and wait for the installer to finish.

capture20170512085905973

Once the installer is finished. Click close and relaunch Visual Studio Preview. Open the Extension Manager again (Tools->Extensions and Updates) and select the Updates tab. After a moment it should indicate that you have some updates available. Select the “Xamarin for Visual Studio” item and click Update.

capture20170512143515227

Close the dialog and restart Visual Studio again.

After that updates, Visual Studio is ready to go. Launch it and create a new Xamarin project.

Select File-New Project to launch the project template dialog and select a Xamarin Forms project from the Cross-Platform section. Then click OK

capture20170512090159500

In the next dialog select whatever type of app you want, then click OK. For this example, I chose “Blank App”

capture20170512090216208

When your project finishes loading, select the iOS project as the default project for the solution and you will see an additional option on the debug menu for “Live Player” (you can ignore and cancel any other dialogs that ask you to connect to a Mac for now)

capture20170512091046004

Click Live Player (or press F5) and the Live Player connection dialog will appear.

snip_20170512145100

Now that you have Visual Studio prepared, you need to get the Live Player app from your phone's app store. The Live Player app is necessary to connect to Visual Studio and load your app.

20170512_134050000_iOS

Run the app and it will open like this

20170512_141424000_iOS

Tap “Pair to Visual Studio” and point your phone's camera at the QR code, or type the alphanumeric code into Visual Studio.

Voila! Your app will appear on your phone!

20170512_141129000_iOS

Remember, this just allows you to easily get the app on your phone for testing. If you want to build a deployment package and send it to the store you still need a Mac connected to Visual Studio.

XamarinU also has a free lightning lecture (30 minute video) on setting this up and using it! check it out at https://university.xamarin.com/lightninglectures/introducing-the-xamarin-live-player 

Comments

  • Anonymous
    May 12, 2017
    great post, really love this new tool
  • Anonymous
    May 15, 2017
    Not working for me. I am running Windows 10 Pro, VS 2017 Preview, and have my iPhone 7 connected via USB. I am running Xamarin Live on the iPhone. When I try to run via "Live Player", it still looks for a Mac. It never brings the Live Player dialog. When I manually start the Live Player (Tools...Xamarin Live Player...Manage Devices), I get the QR, and as soon as the iPhone app scans it, the iPhone app returns to the initial screen. If I type the code into the Live Player UI, clicking on "Connect" or hitting the "Enter" key does nothing.
  • Anonymous
    August 22, 2017
    Thanks for this post! Very helpful.
  • Anonymous
    January 19, 2018
    Doesn't work for me either. Is the preview still needed. I get the following build error: "C:\Users\bjoernb\source\repos\App5\App5\App5\App.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)"