.net.net-mauimaui-blazormaui-ios

.NET MAUI unable to debug iOS on simulator or phone


I'm new to .NET MAUI and I'm experimenting with a MAUI Blazor App. However, I'm having no luck getting it to debug on iOS.

If I have my physical iPhone plugged into my windows machine or my mac on the local network, and try to debug with the local device, I just get this message:

No valid iOS code signing keys found in keychain

If I try to use iOS simulator it brings up a prompt to pair to the MAC. I've followed the guide to enable local sharing and configure the firewall. It seems to connect, I get the username and password prompt, but after some progress indication it halts with the following error:

An error occurred while trying to connect to the Broker... Probed locations for Mono on the Server: mono64, /Library/Frameworks/Mono.framework/Versions/Current/bin/mono64, /usr/bin/mono64, /bin/mono64, /usr/local/bin/mono64, /usr/sbin/mono64, /sbin/mono64, /Users/matthewpaul/Library/Caches/Xamarin/XMA/Runtimes/mono/bin/mono64, mono, /Library/Frameworks/Mono.framework/Versions/Current/bin/mono, /usr/bin/mono, /bin/mono, /usr/local/bin/mono, /usr/sbin/mono, /sbin/mono, /Users/matthewpaul/Library/Caches/Xamarin/XMA/Runtimes/mono/bin/mono

Any pointers on how I might get either/both the local device and simulator working?


Solution

  • If anyone gets the same issue on the iOS simulator, it was re-installing Visual Studio 2022 Preview on the Mac and selecting all mobile related workloads that got it working for me.

    With running the application on a device, there's a guide. You need to add your Apple account to visual studio:

    https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/apple-account-management?tabs=windows

    And enable automatic provisioning (if you've an Apple developer account)

    https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/automatic-provisioning?tabs=windows

    enter image description here

    Or free provisioning if you don't:

    https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning?tabs=macos

    More general info here:

    https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/