Quick Links

I updated my Visual studio 2017 Enterprise to the latest version 15.8.7 recently. VS can build Xamarin Forms project successfully but can't start any iOS simulator. when i click one of simulators in the simulator list, VS will trigger build and do nothing after build. Below the last a few lines in the Output Window:

Best Answer

Try to open the iOS simulator before building your project on Visual Studio 2017.

You can do this by doing the following:
1. On your Mac machine open Spotlight Search (Command+Space)
2. Search for Simulator
3. Once you have the Simulator app open, on the top menu bar, click on Hardware > Device and select your desired device
4. Once your desire simulator is running, on Visual Studio 2017, do a Clean > Build > Run

Hi @ManojkumarMali thanks for feedback. I did have a MAC in my network and pair with it. That's why I can select one of iPhone simulators from Visual Studio. But don't know why Visual Studio just builds the Xamarin Forms program without launching the simulator.

Try to open the iOS simulator before building your project on Visual Studio 2017.

You can do this by doing the following:
1. On your Mac machine open Spotlight Search (Command+Space)
2. Search for Simulator
3. Once you have the Simulator app open, on the top menu bar, click on Hardware > Device and select your desired device
4. Once your desire simulator is running, on Visual Studio 2017, do a Clean > Build > Run

Hi @isesco Thanks a lot for the steps. I restarted the Windows PC and MAC. And started the simulator 'iPhone 6s' on MAC. And then pair with the MAC in Visual Studio 2017 on Windows. And then select simulator 'iPhone 6s iOS12.0'. The issue is still there.

Hi @isesco , thanks a lot for the steps. I have restarted my PC and MAC. And start a simulator 'iPhone 6s' on MAC and pair with the MAC on Visual Studio on PC. And then select simulator 'iphone 6s iOS 12.0' from the simulator list in Visual studio. Then try to start the simulator. but VS still can build the program but not able to show the simulator.

I guess it could be caused by firewall block this port number because in the log file (attached), there are error message as below:

System.Net.Mqtt.Sdk.Bindings.TcpChannelFactory|Error|0|An error occurred while connecting via TCP to the endpoint address 10.3.1.252 and port 52621, to establish an MQTT connection
System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 10.3.1.252:52621
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)

So I contact with our system administrator. He mentioned there is no changes with firewall rules recently.
Then I run command netstat -an | grep 52621
on MAC and found MAC is listening on that port.

Then I run command Test-NetConnection -Port 52621 -ComputerName 10.3.1.252 -InformationLevel Detailed
in PowerShell on Windows PC and the testing result is still OK:

Hi @inimri , i didn't solve this issue yet. Still not sure what caused that problem. I have to downgrade Visual Studio 2017 to version 15.7.6 and XCode to version 9.4.1. These are the versions that works on my PC/Mac before I did VS upgrade.