Skip to content

Build and debug iOS application on Windows with Pair to Mac

Nikita Romanov edited this page Nov 14, 2024 · 6 revisions

Prerequisites

Apple Devices app

Install Apple Devices app from Microsoft Store. This app is used like a driver to connect iOS devices to Windows with debugging support. Run the app and connect your device to Windows via USB cable. Check your device for a prompt to trust the computer and select "Trust". If everything is set up correctly, you should see your device in the list of connected devices in the Apple devices app.

image If you have any issues with connecting your device to Windows, try to restart your PC.

.NET SDK versions

Ensure that the Mac machine contains the same version of the .NET SDK that is used in the Windows machine. For example:

Windows machine:

> dotnet --version
8.0.403

Mac machine:

$ dotnet --list-sdks
9.0.100 [/usr/share/dotnet/sdk]
8.0.403 [/usr/share/dotnet/sdk] ;This is the same version as in the Windows machine
8.0.303 [/usr/share/dotnet/sdk]

If the Mac machine doesn't contain the same version of the .NET SDK as the Windows machine, you will see the ILINK error messages.

Pair to Mac

  1. Open your project in Visual Studio Code.
  2. Press Ctrl + Shift + P to open the command palette.
  3. Find .NET Meteor: Pair to Mac and press Enter.

image

  1. Enter the IP address or hostname of your Mac machine.
  2. Enter the username and password of your Mac machine.

The connection information is saved globally and will be used automatically for future connections. If you need to change the connection information, you can do so by running the .NET Meteor: Pair to Mac command again.

Build and debug

Open your project in Visual Studio Code and select the iOS device from the dropdown list in the status bar.

image

Press F5 to build and debug your application on the iOS device. Please note that you need to start the application manually on the iOS device after the build and deployment process is complete. You will see this message in the VSCode:

image