Telerik blogs

Follow these steps to equip an iOS simulator on your Windows machine to check your .NET MAUI app.

At first glance, running an iOS app from a Windows machine may seem impossible. However, I have good news for you: it is possible. In this article, I will show you a simple way to establish a remote connection from your Windows computer to your Mac, allowing you to run your iOS apps from Windows. Let’s see how to do it!

First of All, What Do I Need?

What is the Remote iOS Simulator for Windows?

The Remote iOS Simulator for Windows allows you to test your applications remotely on Windows in an iOS simulator. This is possible because when you pair with a Mac, you can use its resources.

To take advantage of this functionality on your Windows computer, you need to have Visual Studio 2022 installed. The simulator is automatically installed with .NET MAUI with this one. After installing, open a .NET MAUI application. From now on, you can apply everything you’ll learn below.

Ensure the Remote Simulation Option is Enabled

Remote simulation is an option that is enabled by default. However, you may need to deactivate and reactivate it at some point. To do so, follow these steps:

  1. In Visual Studio, go to the top menu, click on Tools ➡ and then, make in Options.

1. Click in Tools , 2. Click in Options

  1. A dialog box will be displayed, here you must go to the following options: Xamarin ➡ iOS Settings

3. Click in Xamarin , 4. Click in iOS Settings , 5. Check the option

⚠ If you disable debugging for a .NET MAUI app on iOS, keep in mind that the iOS simulator will open on the connected Mac build host.

Launch the App in the iOS Simulator

Now that you’ve made sure that the option is activated, let’s continue with launching your app!

In the Visual Studio toolbar, go to the Debug Target dropdown, click on iOS Simulators, then all the available simulators of the Mac you paired with will appear.

1. Locate in Windows Machine option and make click in the arrow , 2 - Click in iOS Simulators , 3- Select the simulator you want

Once you select a simulator, you can visualize it and start running your applications.

Click to Run

Interesting Facts About the Simulator

➖ Five buttons are displayed on the toolbar located at the top of the window simulator:

Toolbar

  • Home: Simulates the home button on an iOS device.
  • Lock: Enables the simulator to be locked, requiring a swipe to unlock for access.
  • Screenshot: Saves a screenshot of the simulator to \Users\{User}\Pictures\Xamarin\iOS Simulator.
  • Settings: Responsible for displaying keyboard and other settings.
  • Other options: Allows us to see various simulator options such as rotation, and shake gesture.

➖ By right-clicking anywhere in the remote iOS simulator window, you can bring up a context menu that displays all toolbar buttons.

Supplementary Topics to Consider

Logs

In case you face any difficulties with the remote iOS simulator, you can access the logs at the following locations:

  • Mac: ~/Library/Logs/Xamarin/Simulator.Server
  • Windows: %LOCALAPPDATA%\Xamarin\Logs\Xamarin.Simulator

Sounds

If you’re using Windows, you won’t hear iOS sounds. The simulator will play all sounds through the host Mac’s speakers.

Touchscreen

Touch interactions are supported by the iOS Remote Simulator for Windows. If your computer has a touch screen, you can employ the same gestures you would use on physical iOS devices to interact with your app.

Troubleshooting

You may encounter trouble with the iOS Remote Simulator for Windows getting stuck in the following flow:

Connecting to Mac ➡ Checking server ➡ Connected *(and it becomes a loop)*

It could be due to an Xcode configuration issue. To fix this, you just have to delete and restart the simulators on your Mac build host. Apply the following steps:

  1. Check that neither Xamarin Mac Agent (XMA) nor Xcode are currently in use.
  2. Delete your ~/Library/Developer/CoreSimulator/Devices folder.
  3. Run killall -9 com.apple.CoreSimulator.CoreSimulatorService.
  4. Run xcrun simctl list devices.

Wrap-up

That’s all! 🎊 You already know how to start programming your iOS applications in .NET MAUI from Windows!

Thanks for reading this article! 💚💕 See you next time! 💁‍♀️

References

This article was based on the official documentation:

https://learn.microsoft.com/en-us/dotnet/maui/ios/remote-simulator?view=net-maui-7.0


Use a component library in sync with .NET MAUI’s release cadence. Try Telerik UI for .NET MAUI for free.

LeomarisReyes
About the Author

Leomaris Reyes

Leomaris Reyes is a Software Engineer from the Dominican Republic, with more than 5 years of experience. A Xamarin Certified Mobile Developer, she is also the founder of  Stemelle, an entity that works with software developers, training and mentoring with a main goal of including women in Tech. Leomaris really loves learning new things! 💚💕 You can follow her: Twitter, LinkedIn , AskXammy and Medium.

Related Posts

Comments

Comments are disabled in preview mode.