question

Jansam-0841 avatar image
1 Vote"
Jansam-0841 asked Rss-4325 published

Unable to run iOS 14.3 Simulator on VS2019 Windows

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

dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, firewall is disabled. Remote Login it setup on the MAC. iOS Simulator 13.7 works on VS2019 windows box, same setup. Anything above iOS 14 does not work.

1 Vote 1 ·

Please update your VS to the latest. Then refer to this steps to try it. https://stackoverflow.com/a/63809029/10627299

0 Votes 0 ·

First of all, please confrim if you have enabled remote login and configure the macOS firewall on the Mac. Refer to this thread:

https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/connecting-to-mac/

In your windows, please disabled McAfee or others Antivirus software. And if keep the Mac and windows in same internal network.

0 Votes 0 ·
MuraliSelvaraj-0085 avatar image
0 Votes"
MuraliSelvaraj-0085 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jansam-0841 avatar image
0 Votes"
Jansam-0841 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Rss-4325 avatar image
0 Votes"
Rss-4325 answered Rss-4325 published

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.