Unable to run iOS 14.3 Simulator on VS2019 Windows

Jansam 11 Reputation points
2021-01-26T15:02:36.653+00:00

I am having an issue getting iOS 14.3 Simulator running on VS2019 using Mac Mini M1. Simulator works directly on the Mac Mini with Remote simulator to Windows option turned OFF. Firewalls are all off. This is not a Launch Screen issue. Application works when directly deployed to device or when Simulator is running on the Mac.

Log gives the following error:

System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at Renci.SshNet.ForwardedPortLocal.InternalStart()
at Renci.SshNet.ForwardedPortLocal.StartPort()
at Renci.SshNet.ForwardedPort.Start()
at Xamarin.Simulator.Core.Protocol.SshNetworkClientConnection.StartForwardPort(Int32 port, SshClient sshClient) in C:\A\vs2017mb-00002B-1_work\59\s\Xamarin.Simulator.Core\Protocol\SshNetworkClientConnection.cs:line 400
at Xamarin.Simulator.Core.Protocol.SshNetworkClientConnection.<ConnectCoreAsync>d__23.MoveNext() in C:\A\vs2017mb-00002B-1_work\59\s\Xamarin.Simulator.Core\Protocol\SshNetworkClientConnection.cs:line 119
Connection state changed:
State: FailedSetup
Connection state changed:
State: Disconnected
Exit:
Exit Code: 0

Developer technologies | .NET | Xamarin
{count} vote

3 answers

Sort by: Most helpful
  1. Murali Selvaraj 6 Reputation points
    2021-04-27T18:03:20.883+00:00

    I have same issue,

    Startup:
    arguments: --device=AF9D1023-EB15-48CD-A77D-E5CAE3BBE4F7 --launchsim=//Users/x/Documents/Library/Caches/Xamarin/mtbs/builds/App.iOS/cbce4b96aaef53ca76a6a9a20b42cb7b9f5ec9374403aeb954154117f757174e/bin/iPhoneSimulator/Debug/.iOS.app -argument=-monodevelop-port -argument=54742 -setenv=XAMARIN_DEBUG_PORT=54742 --sdkroot=/Applications/Xcode.app -h=10.10.10.19 -ssh=Murali --launched-by=devenv-16.0
    version: 16.7.0.0 (54a29526ef6f853bdd37adbcc3791ce90ca82735)
    Connection state changed:
    State: Connecting
    SSH Connect:
    target: x.x.x.x
    Using SSH pass phrase
    SSH connected
    Connection state changed:
    State: SshConnected
    Connection state changed:
    State: CheckingServer
    Shutting down server
    Connection state changed:
    State: SettingUpServer
    Starting server
    [Server] ready:50222
    Warning: Server setup error
    System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions
    at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Bind(EndPoint localEP)
    at Renci.SshNet.ForwardedPortLocal.InternalStart()
    at Renci.SshNet.ForwardedPortLocal.StartPort()
    at Renci.SshNet.ForwardedPort.Start()
    at Xamarin.Simulator.Core.Protocol.SshNetworkClientConnection.StartForwardPort(Int32 port, SshClient sshClient) in C:\A\vs2017mb-00002B-1_work\59\s\Xamarin.Simulator.Core\Protocol\SshNetworkClientConnection.cs:line 400
    at Xamarin.Simulator.Core.Protocol.SshNetworkClientConnection.<ConnectCoreAsync>d__23.MoveNext() in C:\A\vs2017mb-00002B-1_work\59\s\Xamarin.Simulator.Core\Protocol\SshNetworkClientConnection.cs:line 119
    Connection state changed:
    State: FailedSetup
    Connection state changed:
    State: Disconnected
    Exit:
    Exit Code: 0

    0 comments No comments

  2. Jansam 11 Reputation points
    2021-04-27T18:09:10.64+00:00

    This is still an issue for me and other developers when using the newer Mac M1 machines to develop Xamarin applications. Works fine with older Intel based Mac Book Pro. We have given up remoting the simulator onto windows to debug when using Mac M1.

    0 comments No comments

  3. R_ss 1 Reputation point
    2022-08-09T10:19:41.357+00:00

    I am having the same problem using the latest Visual Studio 2022 Preview and a remotely paired Mac. The iOS simulator window appears but it gets stuck perpetually loading. Error logs below:

    Startup:  
    	arguments: --device=EF1C5A06-E753-4FF1-98E2-96AD2DF275AE --launchsim=//Users/natasha/Library/Caches/Xamarin/mtbs/builds/DrinksApp/269ae0c22755d3a9331db4ac557dccb9718682a3dc268c63706b4d3e8faa0013/bin/Debug/net6.0-ios/iossimulator-x64/DrinksApp.app -argument=-monodevelop-port -argument=59920 -setenv=__XAMARIN_DEBUG_PORT__=59920 --sdkroot=/Applications/Xcode.app -h=192.168.0.106 -ssh=Natasha Mraz   
    	version: 17.3.0.471 (97213889733ed3f399d3574c2f4f20e614e9dc7a)  
    Connection state changed:  
    	State: Connecting  
    SSH Connect:  
    	target: 192.168.0.106  
    Using SSH pass phrase  
    SSH connected  
    Connection state changed:  
    	State: SshConnected  
    Connection state changed:  
    	State: CheckingServer  
    Shutting down server  
    Connection state changed:  
    	State: SettingUpServer  
    Starting server  
    [Server] ready:51214  
    Connection state changed:  
    	State: Connecting  
    Connection state changed:  
    	State: CheckingServer  
    Connection state changed:  
    	State: Connected  
    Start device request:  
    	Current State: Unknown  
    	UUID: EF1C5A06-E753-4FF1-98E2-96AD2DF275AE  
    	Name: iPhone SE (3rd generation)  
    	Platform: iOS  
    	Version: 15.4  
    Device state changed:  
    	UUID: EF1C5A06-E753-4FF1-98E2-96AD2DF275AE  
    	State: Starting  
    Device state changed:  
    	UUID: EF1C5A06-E753-4FF1-98E2-96AD2DF275AE  
    	State: Started  
    SizeForScreen:  
    	Monitor: 0,0,2560,1400  
    	Scale: 1,1  
    	Source: 750,1334  
    	extraHeight: 84  
    Connection state changed:  
    	State: Disconnected  
    Connection state changed:  
    	State: Connecting  
    SSH Connect:  
    	target: 192.168.0.106  
    Using SSH pass phrase  
    SSH connected  
    Connection state changed:  
    	State: SshConnected  
    Connection state changed:  
    	State: CheckingServer  
    Connection state changed:  
    	State: SettingUpServer  
    Starting server  
    [Server]   
    Connection state changed:  
    	State: FailedSetup  
    [Server] ready:51226  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.