Why does my fresh install of Visual Studio with Xamarin have broken iOS simulators?

EasyGoingPatEasyGoingPat GBMember ✭✭✭

I have just done a complete fresh install of Visual Studio and Xamarin on my PC. Now all the iOS simulators give an error similar to the one shown.

I had this error before I reinstalled. The re-installation was an attempt to fix it. I am frankly in disbelief that it is still broken. I seem to spend more time fixing Xamarin than I do coding. Even more worrying is that I spend more time fixing Xamarin now than I did a year or more ago. That's hardly progress.

Has anyone seen this? Does anyone know how I can fix it?

  • Patrick

Best Answer

  • EasyGoingPatEasyGoingPat GB ✭✭✭
    Accepted Answer

    @JohnHair

    This issue appears to have kind-of fixed itself with later versions of Visual Studio and Xamarin (now on Visual Studio 15.9.3 and Xamarin d15.9).

    The build host still has a problem that I have reported as a bug but no longer displays the behaviour described in this thread. I'll therefore mark this note I am writing now as the answer, just to close the thread.

    ~ Patrick

Answers

  • JohnHairJohnHair GBMember ✭✭✭✭✭

    @EasyGoingPat said:
    I have just done a complete fresh install of Visual Studio and Xamarin on my PC. Now all the iOS simulators give an error similar to the one shown.

    I had this error before I reinstalled. The re-installation was an attempt to fix it. I am frankly in disbelief that it is still broken. I seem to spend more time fixing Xamarin than I do coding. Even more worrying is that I spend more time fixing Xamarin now than I did a year or more ago. That's hardly progress.

    Has anyone seen this? Does anyone know how I can fix it?

    • Patrick

    The simulators come from the mac, so a reinstall on your PC won't make any difference.
    Can you run a simulator directly on your mac?
    Have you run XCode on your mac? It is required if it recently updated, as it may need to download additional components.

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭
    edited November 2018

    @JohnHair

    Thanks for the reply, John. I can't believe I have used Xamarin for about two years and not realised the simulators sit on the Mac.

    Unfortunately, uninstalling and reinstalling XCode on the Mac also has failed to fix the problem. (I had already started this before I got your reply.)

    Yes, I can run simulators from XCode on the Mac, so I guess the PC and Mac are somehow out-of-sync. Any idea how to get them talking again?

    I feel my sanity slipping away ...

    • Patrick
  • JohnHairJohnHair GBMember ✭✭✭✭✭

    @EasyGoingPat said:
    @JohnHair

    Thanks for the reply, John. I can't believe I have used Xamarin for about two years and not realised the simulators sit on the Mac.

    Unfortunately, uninstalling and reinstalling XCode on the Mac also has failed to fix the problem. (I had already started this before I got your reply.)

    Yes, I can run simulators from XCode on the Mac, so I guess the PC and Mac are somehow out-of-sync. Any idea how to get them talking again?

    I feel my sanity slipping away ...

    • Patrick

    Hmm, what XCode version are you running? I would check it is on the latest, and that MacOS has been updated too.
    Also, unpair the mac, reboot, try to pair again. Do you then see the iOS 12 simulators in VS on your PC?
    The pc is definitely on the same network as the mac? No firewalls in the way?

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JohnHair

    Unfortunately, John, checking your suggestions has revealed nothing obvious.

    Interestingly, I have just installed Visual Studio on the Mac and that can access the simulators, so I know the simulators on the Mac are intact. The PC just doesn't appear to be able to see them.

    I have the firewall disabled on the Mac and the Windows Defender local network firewall is also disabled.

    I guess one thing I really should have mentioned is what lead to this in the first place. I added a new piece of hardware to my network yesterday that insisted on using the IP the Mac was using. It was miles easier to change the Mac's IP so that's what I did. I figured simply forgetting the Mac in the PC and re-adding it would sort all this out. I have never had a problem before on the rare occasions when I have had to change the Mac's IP.

    If anyone from Xamarin is on here, I do feel that this whole generally excellent product is being let down by the robustness of the connection between the PC and the Mac. Can't you add something like a 'Reset Mac Build Host Link' menu option or something that causes the PC to go through the whole of the Mac discovery process and repairs anything it finds amiss?

    Anyone know how to get the PC to properly accept that the Mac Build Host has simply moved IP?

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JohnHair

    Well, I am now at a complete loss what to try next.

    • XCode is latest and running fine on the Mac with all simulators.
    • Visual Studio Mac can use the simulators.
    • Performed a complete wipe and reinstall of the whole of Visual Studio on the PC.
    • Paired to the Mac.
    • All simulators appear in the list.
    • Trying to connect gives the same error.

    Please, if anyone from Xamarin sees this, do you have any suggestions how I can fix this?

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    This log seems to say quite clearly what is going wrong. But I still don't have a clue how to fix this. I either need to change the GUID of the device being searched for or rebuild the list of devices being searched.

  • JohnHairJohnHair GBMember ✭✭✭✭✭

    @EasyGoingPat said:
    @JohnHair

    Well, I am now at a complete loss what to try next.

    • XCode is latest and running fine on the Mac with all simulators.
    • Visual Studio Mac can use the simulators.
    • Performed a complete wipe and reinstall of the whole of Visual Studio on the PC.
    • Paired to the Mac.
    • All simulators appear in the list.
    • Trying to connect gives the same error.

    Please, if anyone from Xamarin sees this, do you have any suggestions how I can fix this?

    • Patrick

    I found this post: https://stackoverflow.com/questions/41703614/xamarin-ios-simulator-issues-the-device-was-not-found

    It mentions the same error you are seeing for people, and a few have said that it was due to being on different networks.
    I have seen this error before ages ago when we were first setting up our environment. For us it was network related, maybe it will help with your investigation?

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JohnHair

    Thank you for the link. Scary! One guy even reinstalled the whole of Windows 10 only to get the same error!

    This just got even weirder. If you look at the two attached screenshots, one shows the GUID that the PC claims it can't see and one shows the GUID of the simulator I tried to run against on the Mac. The GUIDs are the same. And Visual Studio on the PC managed to put the simulator in its list of run targets, so it seems that Visual Studio is seeing the simulator okay but the run/debug process is not.

    So I guess some kind of connection/networking issue may be the most likely explanation.

    ~ Patrick

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JohnHair

    One workaround for now is unchecking the following setting on the PC: Xamarin | iOS Settings | Remote Simulator to Windows.

    This runs a simulator on the Mac no problem. This really is starting to seem like a Xamarin bug to me. Or at the very least the debug/run process could produce a better error message.

    ~ Patrick

  • JohnHairJohnHair GBMember ✭✭✭✭✭

    @EasyGoingPat said:
    @JohnHair

    One workaround for now is unchecking the following setting on the PC: Xamarin | iOS Settings | Remote Simulator to Windows.

    This runs a simulator on the Mac no problem. This really is starting to seem like a Xamarin bug to me. Or at the very least the debug/run process could produce a better error message.

    ~ Patrick

    I totally agree, if Visual Studio can see the simulators well enough to create the list, then it should be able to run the simulators. That to me points to a flaw in the way Xamarin works with remote sims. But the issue is definitely network related, a situation that Xamarin isn't handling properly, imo.

    At least you have a way forward for now, you can remote desktop to the mac to see the sim and interact with it etc.

  • JohnHairJohnHair GBMember ✭✭✭✭✭
    edited November 2018

    @EasyGoingPat

    Quick question, have you tried pairing to the mac with it's ip address instead of the name? (and vice versa)

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JohnHair

    I do currently connect via IP. But, if you look at the attached screenshot, you can see that the Mac appears twice. Both entries have the same IP but one has the a name and one is just labelled as the IP.

    If I delete this Mac Build Host then both entries vanish. If I re-add the Mac then both entries reappear. This didn't happen before I updated to OSX Mojave and I can't help worrying that this is part of the bug because I can't connect to the entry that has the machine name. It goes partway through the process and then says it cannot resolve the machine name.

    It is as though part of the PC-to-Xamarin link is written on the back of IP addresses and part of it is written to use machine names.

    I have posted this as a bug so hopefully it will get investigated at some point.

    As you say, at least I can work for now.

    Thank you for your help.

    ~ Patrick

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭
    Accepted Answer

    @JohnHair

    This issue appears to have kind-of fixed itself with later versions of Visual Studio and Xamarin (now on Visual Studio 15.9.3 and Xamarin d15.9).

    The build host still has a problem that I have reported as a bug but no longer displays the behaviour described in this thread. I'll therefore mark this note I am writing now as the answer, just to close the thread.

    ~ Patrick

Sign In or Register to comment.