Build together, debug together. Join the community on Discord.→

No More “Pair to Mac” trauma from Visual Studio with Uno Platform

With the rollout of the 4.10 update, Uno Platform has reintroduced the popular feature, Hot Restart. Originally, this feature was a part of Xamarin-based Uno Platform applications. This enhancement allows users to debug an iOS application on an actual device connected to Windows without needing a Mac.

In this blog, we’ll guide you through setting up and using the Hot Restart feature for your Uno Platform iOS apps in Visual Studio. The process includes creating an Uno Platform application, setting up Hot Restart, and finally debugging an iOS application.

This article covers

  • 1. Setting up a Project for Hot Restart: Discover enabling Mac-free iOS debugging on Windows.
  • 2. Issues During Set up: Learn how to configure Hot Restart for iOS debugging, from device connection to Apple account setup.
  • 3. Debugging: Explore Hot Restart’s seamless debugging experience and understand its role in the app submission process.”
     

TLDR: Uno Platform’s Hot Restart in version 4.10 lets you debug iOS apps on Windows without a Mac. This article guides you through setup and provides troubleshooting tips

Creating a New Uno Platform, .NET Mobile Application

For the sake of this sample, we will create a new iOS mobile application

  1. Start by creating an Uno Platform application using the Uno Platform Template Wizard. Ensure Mobile is set as the startup project.
  2. Connect your iPhone/iPad to your Windows PC via USB. The devices dropdown should update to include “Local Device.” If it doesn’t, try rebuilding the Mobile project or close and reopen the solution.
  3. After rebuilding and reopening the solution (if required), you should see “Local Device” under the iOS Local Devices menu item.
New iOS Project with Uno Template Wizard
READ MORE
If you're looking for a deeper dive into the topic, check out iOS Debugging on Windows – Hot Restart article for a more comprehensive look and insight.

Setting Up Hot Restart

  1. When you press F5 or click the Run button, you’ll be prompted to set up Hot Restart. This one-time setup ensures you have the appropriate account, certificates, and provisioning profiles.
  2. You’ll be prompted to install iTunes if you don’t have iTunes installed. Once you’ve done that, you can move directly to the next step of connecting to the device.
  3. Follow the instructions in the dialog shown – you’ll likely need to click Trust on the prompt on the iOS device and then reconnect the device via USB. If you’re unable to access the device in iTunes, Hot Restart won’t work – so ensure you fix this issue first.
  4. You’ll then need to enter your developer account information. If you don’t have a developer account with Apple, you’ll need to go to https://developer.apple.com and register for one.
Setup Hot Restart

Debugging an iOS Application

  1. After completing the Setup Hot Restart process, Visual Studio will attempt to launch your application for debugging.
  2. Each time you start a debugging session using a local device (i.e., using Hot Restart), you’ll see a prompt telling you to launch the application on the device. Reboot your iOS device and tap on the application to launch it. (This may only be required the first time (but generally not at all.)
  3. Once you launch the application, the dialog in Visual Studio will automatically dismiss, and you should be able to debug your application with the usual experience, including breakpoints and step-through debugging.

Just so you know, however, that debugging on older, slower devices might not work as the application might fail to launch in time, resulting in iOS terminating the application. Furthermore, while Hot Restart eliminates the need for a Mac for debugging purposes, you will still need a Mac somewhere in your build process to produce an application you can submit to the Apple Store.

Next Steps

As always, we appreciate all contributions and feedback from our community. Don’t forget to try out the Hot Restart feature in the latest release. We’re looking forward to hearing about your experiences!

To upgrade to the latest release of Uno Platform, please update your packages to 4.10 via your Visual Studio NuGet package manager! If you are new to Uno Platform, following our official getting started, guide is the best way to get started. (5 min to complete)

Nick Randolph

Nick Randolph

Follow Nick on Twitter

Tags:

Uno Platform 5.2 LIVE Webinar – Today at 3 PM EST – Watch