Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xamarin for visual studio not showing simulator list

I'm pretty new to xamarin, tried to run a sample application (IOS). But Visual Studio says: "Please select a valid device before running the application"

I know on the IOS toolbar, there should be option to select which device to simulate (list of supported IOS devices like iphone 6, 5s etc), but I don't get that.

EDIT: To be more precise, TARGET IOS Device not shown on IOS Tool bar

like image 778
Owen Avatar asked Oct 02 '15 18:10

Owen


Video Answer


3 Answers

I had the same problem a year back - please check the following:

  • XCode is installed
  • you have started XCode once (to accept license agreement)
  • Xamarin Build Host is installed
  • Visual Studio and Mac Build Host are connected
  • Simulators work on MAC-side when started with XCode (just use a sample project)
  • Check that you are using latest versions of Xamarin (often, there are major bugs in intermediate versions of Xamarin that are updated relatively quickly), also check that they are compatible with your XCode version and that VS and Mac versions are compatible (only certain versions can cooperate)
  • using non-latest versions on Mac side can help (e. g. new XCode releases often are unsupported for a few days till there is an update on Xamarin side)
  • Make sure that iOS project is selected for start
  • Sometimes, you need to re-establish connection with Build host for things to work properly
  • Sometimes, you need to restart your systems
  • You got correct licenses (you need Business or Enterprise on both Windows and Mac)

I think for me it was outdated versions and a hickup in the software, after a reboot it worked.

like image 58
Andreas Reiff Avatar answered Oct 13 '22 00:10

Andreas Reiff


  1. Quit Visual Studio.
  2. Open your XCode.
  3. Restart Visual Studio.
  4. Select your ios app > Debug > "Now you can see list of simulators"
  5. Quit Xcode.

OR If above steps do not work then try adding new build configuration as shown in following image by selecting iphoneSimulator.

enter image description here

like image 43
Venu Gopal Tewari Avatar answered Oct 13 '22 00:10

Venu Gopal Tewari


Once in a while I always used to have this issue and solves it by starting Xcode first and then opening VS after. But recently it became consistent after Xcode 12.5 update. So as a trial, I uninstalled VS and reinstalled and now this workaround also stopped working. It's very annoying and there is a bug already reported to Microsoft to fix this.

The solution that worked for me is to

  1. Create a multi platform sample project in VS, and viola! I could see all my simulators in my sample project.
  2. Now, close this solution (no need to close VS) and open your solution. All your simulators are back.

Unfortunately, you always have to open your sample sln first (but no need to create new sln every time) whenever you want to open your solution. But it solves the problem.

like image 30
Renji Avatar answered Oct 12 '22 23:10

Renji