On Windows? Try the Visual Studio 2017 walkthrough.
Install the Xamarin Live Player App
- Download the Xamarin Live Player App to your iOS device:
Alternatively, use the Camera app in iOS 11 to scan the following QR code from your device to open the Xamarin Live Player in the App Store:
- Make sure that your iOS device and Mac are connected to the same Wi-Fi network.
Let's Get Started
In this walkthrough, you'll pair your iOS device to Visual Studio for Mac. Once your device is paired with the IDE, you'll learn how to use the Live Run Current View feature to display the current XAML page on your device, and will get a chance to edit the XAML and see it appear instantly.
- First, download the LiveView sample.
- While the sample is downloading, enable the Xamarin Live Player in Visual Studio for Mac. To do this go to Visual Studio > Preferences… and select Projects > Xamarin Live Player (Preview). Then select the Enable Xamarin Live Player checkbox:
- Locate the downloaded sample and double-click the .sln file to open it in Visual Studio for Mac:
- Pair your iOS device and Visual Studio for Mac. To do this both devices must be on the same Wi-Fi network. Once you have ensured both devices are on the same network, select Tools > Manage Live Player Devices… from the menu bar:
- Open the Live Player app on your iOS device:
- Press the Pair to Visual Studio button in the Live Player app:
The app will open a camera viewfinder for you to scan the QR code displayed in the Manage Live Player Devices dialog.
- Scan the QR code, or enter the code in Visual Studio for Mac, to complete the pairing process:
- Set the device configuration to LiveView.iOS > Debug|iPhone and select your device under Live Player from the configuration list:
- From the LiveView Project, double-click MainPage.xaml to open it in the code editor:
- To run this XAML page as a live view on your device, select Run > Live Run Current View from the menu bar:
You can now start editing the XAML, and you'll see it appear on your device after a second or so. For example, try any or all of the following, or try your own:
- Change the Label Text:
<Label Text="I Love Xamarin.Forms!" FontSize="Small" VerticalOptions="CenterAndExpand HorizontalOptions="CenterAndExpand" />
- Add a Button:
<Button Text="Click Me!" TextColor="Olive" />
- Add a monkey Picker:
<Picker Title="Select a monkey" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand"> <Picker.Items> <x:String>Baboon</x:String> <x:String>Capuchin Monkey</x:String> <x:String>Blue Monkey</x:String> <x:String>Squirrel Monkey</x:String> <x:String>Golden Lion Tamarin</x:String> <x:String>Howler Monkey</x:String> <x:String>Japanese Macaque</x:String> </Picker.Items> </Picker>
- Change the Background Color of the StackLayout:
<StackLayout BackgroundColor="Maroon"> ... </StackLayout>
- Change the Label Text:
This first walkthrough is designed to show you how to use Visual Studio for Mac and the Xamarin Live Player to launch a XAML view to your device.
The next step with Xamarin Live Player on iOS is to sign up for the Xamarin Live Player app Alpha Program. It is highly recommended that you sign up for the program. Signing up provides access to the latest up-to-date builds through Apple's TestFlight service, and gives you the oppertunity provide valuable feedback on the future of the product. To sign up, fill in the Alpha Program Agreement.
If you have issues with the Xamarin Live Player, check out the Troubleshooting guide for additional help.