Visual Studio 2017 (15.8.7) - Xamarin Forms project can build but not able to start iOS simulator

yyouyyou Member ✭✭

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:

========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Build started.
Build succeeded.

I had a look at the folder %LOCALAPPDATA%\Xamarin\Logs\Xamarin.Simulator in Windows PC and folder ~/Library/Logs/Xamarin/Simulator.Server on MAC, there is no log file generated.

Does anyone have the same issue or let me know how to trouble-shooting?

Best Answer

Answers

  • ManojkumarMaliManojkumarMali USMember ✭✭✭

    Hi,

    Do you have any mac machine connected in LAN?
    Because to run iOS simulator you need macOS connected to your vs on windows.

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

  • yyouyyou Member ✭✭

    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.

  • yyouyyou Member ✭✭

    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.

    Below is what I found from the Output Window of Visual Studio 2017.
    1>------ Build started: Project: App1.iOS, Configuration: Debug iPhoneSimulator ------
    1> Connecting to Mac server 10.3.1.252...
    1> App1.iOS -> C:\projects\App1\App1.iOS\bin\iPhoneSimulator\Debug\App1.iOS.exe
    1> Detected signing identity:
    1> Bundle Id: com.companyname.App1
    1> App Id: com.companyname.App1
    ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
    Build started.
    Build succeeded.

    if I choose 'Show output from: Xamarin', below is the log:

    Checking host configuration for connecting to '10.3.1.252'...
    Checking SSH configuration...
    Checking available disk space...
    Checking Mono installation...
    Checking Xamarin iOS installation...
    Checking host configuration for connecting to '10.3.1.252'...
    Host '10.3.1.252' is configured correctly
    Starting connection to '10.3.1.252'...
    Starting Broker 1.1.6.170 in port 52621...
    Starting connection to '10.3.1.252'...
    SSH connection to '10.3.1.252' has been established...
    Starting registered Agents: Build 4.11.0.776, IDB 4.11.0.776...
    Starting Build 4.11.0.776...
    Starting IDB 4.11.0.776...
    Build 4.11.0.776 started
    IDB 4.11.0.776 started
    Starting registered Agents: ...
    The Agents have been started successfully
    Performing server validations against '10.3.1.252'...
    Validating Mac operating system version compatibility...
    Validating Xcode license state...
    Verifying installed Xcode tools...
    Checking Xcode tool package 'MobileDeviceDevelopment.pkg' installation...
    Xcode tool package 'MobileDeviceDevelopment.pkg' is up to date
    Checking Xcode tool package 'MobileDevice.pkg' installation...
    Xcode tool package 'MobileDevice.pkg' is up to date
    Checking Xcode tool package 'XcodeSystemResources.pkg' installation...
    Xcode tool package 'XcodeSystemResources.pkg' is up to date
    Performing server validations against '10.3.1.252'...
    Connection to '10.3.1.252' completed successfully
    Beginning build for C:\projects\App1\App1.iOS\App1.iOS.csproj. Properties: DeviceSpecificBuild: false, TargetiOSDevice: , ServerPort: 52621, ServerUser: gpsynergy, ContinueOnDisconnected: False, ServerAddress: 10.3.1.252

  • yyouyyou Member ✭✭
    edited October 2018

    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.

    build log from Output window:

    1>------ Build started: Project: App1.iOS, Configuration: Debug iPhoneSimulator ------
    1> Connecting to Mac server 10.3.1.252...
    1> App1.iOS -> C:\projects\App1\App1.iOS\bin\iPhoneSimulator\Debug\App1.iOS.exe
    1> Detected signing identity:
    1> Bundle Id: com.companyname.App1
    1> App Id: com.companyname.App1
    ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
    Build started.
    Build succeeded.

    //no more text

    Xamarin log from Output window:

    Checking host configuration for connecting to '10.3.1.252'...
    Checking SSH configuration...
    Checking available disk space...
    Checking Mono installation...
    Checking Xamarin iOS installation...
    Checking host configuration for connecting to '10.3.1.252'...
    Host '10.3.1.252' is configured correctly
    Starting connection to '10.3.1.252'...
    Starting Broker 1.1.6.170 in port 52621...
    Starting connection to '10.3.1.252'...
    SSH connection to '10.3.1.252' has been established...
    Starting registered Agents: Build 4.11.0.776, IDB 4.11.0.776...
    Starting Build 4.11.0.776...
    Starting IDB 4.11.0.776...
    Build 4.11.0.776 started
    IDB 4.11.0.776 started
    Starting registered Agents: ...
    The Agents have been started successfully
    Performing server validations against '10.3.1.252'...
    Validating Mac operating system version compatibility...
    Validating Xcode license state...
    Verifying installed Xcode tools...
    Checking Xcode tool package 'MobileDeviceDevelopment.pkg' installation...
    Xcode tool package 'MobileDeviceDevelopment.pkg' is up to date
    Checking Xcode tool package 'MobileDevice.pkg' installation...
    Xcode tool package 'MobileDevice.pkg' is up to date
    Checking Xcode tool package 'XcodeSystemResources.pkg' installation...
    Xcode tool package 'XcodeSystemResources.pkg' is up to date
    Performing server validations against '10.3.1.252'...
    Connection to '10.3.1.252' completed successfully
    Beginning build for C:\projects\App1\App1.iOS\App1.iOS.csproj. Properties: DeviceSpecificBuild: false, TargetiOSDevice: , ServerPort: 52621, ServerUser: gpsynergy, ContinueOnDisconnected: False, ServerAddress: 10.3.1.252

    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:

    ComputerName : 10.3.1.252
    RemoteAddress : 10.3.1.252
    RemotePort : 52621
    NameResolutionResults : 10.3.1.252
    MatchingIPsecRules :
    NetworkIsolationContext : Private Network
    InterfaceAlias : Ethernet 2
    SourceAddress : 10.3.1.254
    NetRoute (NextHop) : 0.0.0.0
    TcpTestSucceeded : True

    I also attached the log file.

    Really don't know what else I can do.

  • inimriinimri USMember ✭✭

    Hi,
    where you able to resolve this issue?
    i have the same issue with simulator or an iPhone connected to the Mac.
    build succeeds, but app doesnt get deployed

  • yyouyyou Member ✭✭

    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.

Sign In or Register to comment.