Regular solvable issue with Visual Studio macOS Pairing Error

Vladislav Matisuhin 5 Reputation points
2024-01-19T12:18:26.2433333+00:00

I am working on a MAUI project, and recently, we encountered an issue with connecting and deploying to iOS devices. In summary, we have one Mac shared among three developers, and each developer needs to:

  • Establish a Pair connection with the MacBook through Visual Studio
  • Connect the local iOS device to the Mac
  • In the project's Run tab, select iOS Remote Devices, choose the device, and run the project

The problem that all developers faced is that, for no apparent reason, Visual Studio started throwing an error in the Pair menu for the Mac (see attached screenshot). After searching the forums, I found a solution that involves the following steps:

  1. Close Visual Studio
  2. Delete C:\Users\UserName\AppData\Local\Xamarin\Mono Touch
  3. Start Visual Studio
  4. Delete the XMA folder (under ~Library/Caches/Xamarin) from the Mac (if not deleted earlier)
  5. Disconnect and pair the Mac again

This solution works, and everything goes back to normal until the next day when the issue resurfaces.Items

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,441 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,618 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Pinaki Ghatak 2,225 Reputation points Microsoft Employee
    2024-01-20T12:03:02.5733333+00:00

    Hello @Vladislav Matisuhin

    It seems like the problem is recurring despite the temporary solution you found.

    Based on the information you have provided and the screenshots, there are a few additional steps you could consider:

    1. In Visual Studio, go to the tools tab and select Apple Accounts.
    2. Remove any previously added accounts.
    3. Press the Add button and select Individual Account.
    4. You will be asked to fill in Api Key fields. To generate an API key to use with the App Store Connect API, log in to App Store Connect. Select Users and Access, and then select the API Keys tab.

    Also, ensure that your .NET MAUI app builds on top of Apple’s provisioning process, which requires you to have created an Apple ID.

    If the issue persists, it might be a bug on the Apple side. Until they fix this, you might have to use the Mac as the display. In Visual Studio, go to Tools > Options > Xamarin > iOS Settings and disable “remote simulator to Windows”. The simulator will be started on the Mac, but even hot reload should work.

    I hope this helps. If so, please tag this as answered, so community readers having same issues can benefit from this.


  2. Mark Perry 1 Reputation point
    2024-01-24T15:52:58.2633333+00:00
    0 comments No comments