1

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?

MIP
  • 6,416
  • 1
  • 17
  • 8
  • also A - insure the ios version you try to tebug on is up to date, B - check that you have no relations to production environment inside your entitlements.plist – Nick Kovalsky Nov 18 '22 at 06:07

2 Answers2

2

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/

MIP
  • 6,416
  • 1
  • 17
  • 8
0

Visual studio has to be open on both sides and xcode too on Mac.

You have to use the same account on mac and on windows.

That's what I had to do to use the sim.

You can follow the same guide I did:

https://www.c-sharpcorner.com/article/pair-to-mac-m1-chip-from-windows-machine-for-maui-ios-development-using-visual-s/

Hope it helps!

  • I've made some progress re-install VS22 preview on the Mac and including all the mobile workloads (I'm convinced I did first time, but have re-done it). It now connects and I can at least run a vanilla .NET MAUI app on the simulator. I don't seem to need visual studio or xcode actually open on the Mac, nor do I need to use the same account on both machines. I still hit the same issue debugging on an actual device (and incidentally can't get SQLite running on the iOS simulator so far). – MIP Jul 20 '22 at 11:55