Xamarin iOS simulator issues - The device was not found - xamarin

I am trying to use the Xamarin iOS simulator but it fails on launch with a "The device {guid} was not found".
I have my environment settings like...
and when I run I see...
then...
researching the error, the recommendation is to explicitly set the XCode path which I have done, but I get the same error. Also, notice I am connected to our build Mac.
I have a coworker connected to the same Mac with the same computer and VS version I am on, and his iOS simulator works fine. I have uninstalled/reinstalled the simulator and restarted Visual Studio (2017RC).
I appreciate any pointers someone might have!
UPDATE
I reinstalled my Windows 10 OS thinking I had a corrupt install. Unfortunately on a clean machine with 2017RC, the simulator still fails in the same way as I described above.

In my case: UnCheck Remote Simulator to Windows

I am facing the same issue from last two days and solved this as well by removing the latest version of XCode 12.5.
Download the previous version of code i.e 12.4 from apple site and install
Move the downloaded xcode file in application and check on windows
It works fine
Latest version of XCode 12.5 is not stable

I confirm the issue is currently (May 2021) caused by Xcode 12.5 upgrade.
After I downgraded back to Xcode 12.4, the simulators started to work again with no problem.
I tried to upgrade Visual Studio for Windows to latest version 16.9.4, did not help. I launched Visual Studio Installer to reinstall Xamarin, did not help either.
Only when I removed Xcode 12.5 (using this shell script https://onexlab-io.medium.com/uninstall-xcode-from-macos-eca1b69dc836) and installed version 12.4 (from XIP archive from here How to download Xcode DMG or XIP file?) it started to work.

You may need to uncheck "Remote Simulator to Windows." I just fixed this issue for myself by doing so. However, I was trying to launch on the iOS simulator on my Mac side (running Windows vm via Parallels). It seems you might be trying to launch the simulator in windows.

If you need a quick solution, downgrade the version of VS and Xcode, for me this works:
VS 2019 - 16.9.3
Xcode - 12.4
Xamarin.iOS - 14.14.2.5
And for physical devices make sure Hot Restart is not enabled in Tools > Options > Xamarin > iOS settings

Just had the same problem after upgrading mac to Big Sur and Xcode 12.5 yesterday. Reboots and deleting obj/bin/.vs folders made no difference. The fix was to explicitly type the Xcode path into Xamarin options iOS settings - even though it was the default - untick Remote Simulator to Windows then pair/connect to mac from that options dialog. After closing the dialog and reopening it Remote Simulator was checked again. I unchecked it, closed the dialog and reopened it to check again - it was closed this time. All works fine now.
I also ran mac VS and let it update in the midst of all this.

I have the same issue since yesterday, to resolve that I uninstall the "Xamarin iOS simulator" and now it works...
it may be a solution for your issue!

Did you resolved the issue already?
I bumped onto the same issue today. I tried opening Xcode on Mac and it says it need to install additional tools. I let it install and try open/quit Visual Studio for Mac, Xcode, Simulator again (not sure if it is related)
Now to remote simulator works fine again.

I had the same issue and i resolved it by realizing that my PC with VS was on a different network than my Mac with Xcode. Once i put both machines on the same network the issue went away. Hope it helps.

Related

How to overcome "Please select a valid device before running the application." on a paired with Mac Visual Studio on Windows 10

I have a Win10 computer paired with Mac. Until today all things were okay, but today I start getting the message:
Please select a valid device before running the application
when I try to debug an iOS Xamarin application on a selected iPhone simulator.
My configurations:
Mac:
OS: Mac OS Catalina, version 10.15.7
XCode Vesion: version 12.2
Visual Studio 2019: version 8.8.4 (build 30)
Win 10:
OS: Win10 version 10.0.19042.685
Visual Studio 2019: version 16.8.3
Simulator names are available on my Win10 computer, but when I select one and try to debug an iOS application I get the message I reported above.
If I launch debug on the Mac directly it runs and starts debugging on the selected iPhone simulator. But when I do the same on the paired Win10 computer in Visual Studio I get this message.
I searched google and SO for this issue and according to advises downgraded XCode to the most possible version 12.2 that is supported by Visual Studio. But it does not change anything.
I want to debug application only on simulator on the paired Win10 computer.
Is there a way to fix this issue?
Looks like the problem was related to the connection between my Win and Mac computers.
My steps to resolve this issue:
I opened Tools - Options - Xamarin - iOS Settings on Visual Studio on my Windows computer. On the Pair to Mac dialog window I selected "Forget this connection" (right click context menu on the connection).
Next, on my Mac, I turned off Sharing (System - Preferences - Sharing).
Then I restarted my Mac computer. And then turned On sharing again, specifying my username as allowed users.
Next on my Windows computer, in the Visual Studio, on the Tools - Options - Xamarin - iOS Settings section I paired my Mac again.
Voila. All things work as expected!
If anyone else runs into this question today, I found this GitHub issue for XCode 13 issues with Xamarin.ios
https://github.com/xamarin/xamarin-macios/issues/12778
I fixed the issue by manually installing xamarin.ios-15.0.0.6.pkg on my mac (linked in the GitHub issue)
When connecting to mac through visual studio it showed the error "The Xamarin.iOS SDK version '15.0.0.6' that is installed on the Mac is not compatible with this version of Visual Studio. Would you like us to install Xamarin.iOS '14.20.0.25' for you? This will overwrite any other existing Xamarin.iOS installation on your Mac."
But, if you hit cancel it should still connect successfully.
Same issue diff version. VS MAC stand-alone also had some issue as VS WIN connected to VS MAC. Started at some early today. Suspected an update somewhere. Traced issues to auto update of XCode to 13. Solution was to download and reinstall XCode 12.5.1 from Apple Dev site. With XCode 12.5.1 things worked. So, something changed with the API in XCode and Xamarin was not prepared for it.
Restarting Visual Studio in Windows worked for me after successfully building.

The selected device was disconnected and cannot be accessed anymore from this machine

I am trying to run my Xamarin app in debug mode on an iPhone 11. But I'm getting a "cannot be accessed" error.
And when I attempt to open the simulator I get the following error.
I've upgraded to the latest version of Rider (2020.2.3) but I'm still getting the issue. Why can't I run my app on iPhone?
You need to install additional XCode components—likely because of a recent MacOS update. Do the following:
Open XCode
Click "Install" when prompted
Once the components have been installed, you should be able to run your app on an iPhone.
I had the same issue, but nothing was updated on my machine. I ended up rebooting my iPhone, which fixed the problem for me.

Workaround for Xcode closing after creating macOS app?

I installed Xcode 11.2.1 GM seed (I heard that 11.2 was buggy). The issue is that whenever I create any type of macOS app on Xcode, it closes itself after a few seconds. I had Xcode 11.1 and I had the same issue with it too. Has anyone found a solution/workaround for this problem? By the way, my Mac is 10.14.6 and I run it on VMWare Virtual Machine.
I found a workaround to this issue. Weirdly, when you create a macOS app choose "None" for team option. And then the project will open without any sudden crashes.

Mac Visual Studio 8.2.6.26 update not showing any iOS simulators, only Generic Simulator

Yesterday I updated my Visual Studio and Xcode. Immediately afterward I lost any listing of available iOS simulators for my Xamarin project in Visual Studio. I can plug my iPhone in however and deploy my project onto it just fine, but I'm used to working with Preview in VS and also running a simulator for quicker response.
I'm currently running the following versions:
• Updated to Xcode 11 (11A420a)
• Visual Studio Mac 8.2.6.26
• Mac OS 10.14.6
• iOS 13.0 on iPhone 7+
Now Visual Studio shows the only available simulator as being the Generic Simulator with a hammer, which doesn't launch anything that I can tell. When I look at the list to choose a simulator I see the message line: "Lower the 'Deployment Target' to see older simulators or check your Apple SDK path"
When I launch a test project directly from within Xcode, it offers iPhone 8, 8+, 11, 11 Pro and others as available simulators and those indeed work. In Visual Studio I have changed each Deployment Target from 6.0 to 12.2 and not one of those makes available any simulators.
I'm not sure what the Apple SDK path is about, how to check it and where it needs to be pointing.
Does anyone have any thoughts about what adjustments need to be made to regain my iOS simulators in Visual Studio Mac again after these updates?
Thanks so much :)
After trying a bunch of suggestions, this simple fix worked for me. First I changed my deployment target in the info.plist from 9.3 to 11. After checking that my Apple SDK path in VS was pointing at Xcode11 and the iOS SDK version on my Mac was 13.0, I simply force quit Visual Studio and Restarted my computer. Then I began to see iPhone8 & iPhone11 simulators. Goodluck.
Updating both XCode and Visual Studio for Mac worked for me.
Just updating XCode did not work.
I also fidgeted with the Deployment Target which I believe refreshed the simulators list.
UPDATE: I confirm again that when I go to info.plist and just click on the deployment target drop down, the simulators list gets update. Little funny.
Ran into this issue many times for the last updates. Nothing really helped, until I came across a Microsoft forum where someone mentioned the Apple SDK path needs a trailing slash, which is not added when using the Browse button to navigate to the Apple SDK Location.
So when using Visual Studio for Mac, navigate to Visual Studio -> Preferences -> Projects -> SDK Locations -> Apple and please note your Apple SDK Location should be something like:
/Applications/Xcode.app/
rather than
/Applications/Xcode.app
Changing the "Minimum System Version" did the trick for me.
Eg. I had 14.4 and I changed it to 14.0 and restart VS the all the simulators appreared.
I resolved the issue as well by going under the Visual Studio --> Check for Updates menu and switching the channel to "Xcode 11 Previews". Finally some updates were available and I updated everything normally. I also updated everything in the "Stable" and "Preview" channels as well. Now I have iPhone 8 and iPhone 11 simulators working, however I no longer have any of the other simulators like iPhone 7, etc. like I did before.
After updating Xcode via the app store, restart your machine. The simulators should reappear.
UPDATE
This didn't work for me after the latest update. However, setting the startup project to Android, then switching back to iOS was enough to repopulate the list for me after restarting my machine.
info.plist has an option called Minimum supported version which says which version of the iOS you are targeting.
in my case it was 10.3 earlier, when i have upgraded xcode (12.4) and vs for mac(8.9.6) to support iOS14. this caused the conflict between the xcode supported iOS version and plist version.
I changed it to 14 in plist for the Minimum supported version and it worked for me.
In summary check the xcode supported version and update the minimum supported version accordingly
Same here, just need to change 'Minimum system version' on your info.plist file in my case was 12.0 and then updated to 12.1 and vualaaaaa the simulator list refresh it.
I had the same problem when the iOS 14 updates were first installed. I had already installed both XCode and VS updates.
What I did is: I restarted the Mac and I had to install the XCode Command-line tools from VS separately. Then the simulators were visible.
What always works for me is connecting an iPhone device. After I connect it, the simulators appear. I guess connecting a physical device also refreshes the simulators list.
This time, nothing was working for me, until I deleted /Library/Caches/Xamarin/XMA and /Library/Caches/Xamarin/mtbs and restarted VS. That helped.
Here's the actual solution if updating everything else still doesn't work. Open terminal, type in "instruments -s devices" to see a list of all the installed simulators.
In your info.plist set "Minimum System Version" to match the lowest simulator version you have installed.
After plugging in my physical phone with the usb cable, the list of simulator devices appeared in like 2 seconds... Before plugging in my phone, only the generic simulator and my phone were shown as deployment options
Just restart of my Mac worked...

Android studio quit unexpectedly on Mac Catalina beta

I installed the latest version of Mac OS (Catalina Beta 10.15) and faced with the following problem: when I open Android studio and start writing code studio quits with such crash report. Can you help me to solve this problem, as it really doesn't allow to work normally. I think that re-installing can help, but maybe there are any other solutions?
*Message in a code style, because pastebin links require that *
It's a know problem in several JetBrains based products.
As a workaround, add -Dsun.font.layoutengine=icu into Help | Edit Custom VM Options and restart IDE.
Also see: Unexpected crash when I update my MacBook Pro to MacOS Version 10.15 Beta (19A501i)

Resources