How to use Xamarin's IOS Remoting Simulator

10,432

Solution 1

iOS Simulator (for Windows)

Preview Installer:

Download the preview installer and install on your Windows computer.

http://download.xamarin.com/xamarin-simulator/Xamarin.Simulator.Installer.0.9.0.25.msi

To enable the remoted iOS Simulator:

Make sure Visual Studio has connected to your Mac at least once before starting the remoted iOS Simulator.

Go to Tools > Options > Xamarin > iOS Settings and tick the box for Remote Simulator to Windows:

enter image description here

https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/

Update - Troubleshooting:

  • Update Xamarin on both your Windows and Mac machines to the latest alpha version.

    ** Your Xamarin plugin for VisualStudio version should now be 4.2.021+

(Verified via Tools \ iOS \ Mac Agent Console)

gv Broker42021
Requesting version of client Broker42021...
Waiting for response...
Current version of client Broker42021: 4.2.0.21

  • Install the Xamarin Simulator on Windows (via the download link above)

Note: This will be installed to C:\Program Files (x86)\Xamarin\Simulator


  • On the Mac, Kill all the Xamarin agents running on your Mac:

    ps ax |grep Mono.framework

Note: When everything is running fine, you will have five (5) Mono processes running, one of which is the Xamarin.Simulator.Server.exe process:


/Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Users/sushi/Library/Caches/Xamarin/XMA/Broker/4.2.0.21/Broker.exe
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Users/sushi/Library/Caches/Xamarin/XMA/Agents/IDB/4.2.0.21/IDB.exe
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Users/sushi/Library/Caches/Xamarin/XMA/Agents/Build/4.2.0.21/Build.exe
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Users/sushi/Library/Caches/Xamarin/XMA/Agents/Designer/4.2.0.21/Designer.exe
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Users/sushi/Library/Caches/Xamarin/Simulator/Server/Xamarin.Simulator.Server.exe

Buyer beware:

ps -ax |grep Mono.framework | cut -c 1-5 | xargs kill

  • On the Mac, kill all current sshd processes:

Note: This is assuming you are not doing this via an ssh connection ;-)

Buyer beware:

ps -ax |grep sshd | cut -c 1-5 | xargs kill

Note: You need to be root to do that, sudo su first


  • Over on Windows, kill ALL the Xamarin.Simulator running tasks

Note: We had a few Windows PC that had hundreds(!) of these running (?!!) (we just rebooted that machine), but found most of the ones failing to run/view the Simulator on Windows had 3-5 of these tasks running.


  • Since you killed all the agents on the Mac machine, Visual Studio/Xamarin will no longer be connected to the Mac, so re-connect.

Note: Make sure that you have Remote Simulator to Windows option already checked before reconnecting to the Mac build host.


  • F5 / Debug - Start Debugging your iOS project

  • Flip over to task manager and you should see one Xamarin.Simulator process running now:

enter image description here


  • After a second or two and some CPU usage spikes on that process and it should appear:

enter image description here


Tested on:

  • Parallels Desktop 11 / Business Edition (11.1.2+) ** Mac host / Windows Guest
  • Physical Windows and Mac machines

My Parallels setup that I use on all deployed Macs:

In the Parallels VM (Windows) configuration, add a second network adapter to the Windows guest that is assigned as a Host-Only and use that IP address as the Mac host for Xamarin connections, NOT the public, shared or bridged IP addresses.

Within Windows, disable the Firewall on this host-only adapter.

Do not use the bonjour/Window sharing Mac host name (XXXX.local), use the private IP address that is assigned to the host-only interface/network adapter. Add another Mac connection and enter the IP address, not the host name, and do not use one that Xamarin auto-adds to the list that includes the XXXX.local host name...

In the Mac, if using Little Snitch make sure that you have a rule that allows inbound connections from that Windows host-only IP address range to the launchd process (/sbin/launchd is the process that spawns the sshd processes)

Still not launching the Simulator?

Check your Mac Console:

If you see items like:

4/30/16 11:18:00.993 AM sshd[59748]: error: connect_to 127.0.0.1 port 52421: failed.

I would assume Little Snitch (or other Mac-based firewall) is blocking the reverse secure tunnel that Xamarin is creating. I do not know why this does not cause all the other Xamarin agents (build, designer, etc..) to also fail. Disable Little Snitch to confirm (kill all Xamarin agents and sshd processes and start over). If the remote Simulator works, review your Little Snitch/firewall rules, something is amiss.

Solution 2

Remote simulating requires enterprise

https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/

Remoted iOS Simulator requires a Visual Studio Enterprise license
Share:
10,432
Dean Chalk
Author by

Dean Chalk

I work for British Petroleum (BP) in the UK as a senior software developer. I specialise in complex and high-performance Windows desktop user interfaces. I am an Enterprise software developer with over 20 years software development experience. Over the years I have been a developer in many technologies, but I am an expert in Microsoft software development for thick-client desktop apps (WPF / Winforms / UWP), which I have specialised in since 2004. Since 2006, I focus exclusively on XAML based enterprise application development (WPF & UWP).

Updated on June 14, 2022

Comments

  • Dean Chalk
    Dean Chalk about 2 years

    Apparently the new Xamarin iOS remoting simulator for Windows is available in the Xamarin Alpha channel for Visual Studio on Windows.

    However, there seems to be no mechanism by which it will appear. There seems to be no buttons or options to show this new iOS simulator in Windows.

    There is zero documentation online, or videos or forum answers relating to this

    If anyone from Xamarin is following this tag, can you please elaborate.

    Thanks

  • Dean Chalk
    Dean Chalk about 8 years
    Does it work if Im on a Mac running Visual Studio in a VM ? Only I get nothing
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk I do not know if that is a supported environment currently, it "should" be as that is combination is a directly supported one Mac Host/ Windows Guest... It is not listed in the Issue list @ developer.xamarin.com/guides/cross-platform/windows/… (just AppleWatch is listed as not working yet)
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk Talked to a couple of devs here who have been using the iOS remote preview and they said to make sure that you updated Xamarin on both your Mac and Windows (host and guest)
  • Dean Chalk
    Dean Chalk about 8 years
    Yeah, both Mac (host) and Windows VM (guest) have just been updated completely on the alpha channel . So it's still a mystery. I am using parallels pro edition for virtualisation
  • adamhill
    adamhill about 8 years
    I am also having issues. Build and deploy to Mac simulator is working fine. Turn on Remote Simulator. Nothing. VS does go orange but the status bar at the bottom stays on "Launching..." I can terminate debugging normally. Tried turning off Remote, deploying app, then re-enabling the Remote. No luck. Looked in the .log and .svclog and see nothing. Otherwise Alpha is working great.
  • Dean Chalk
    Dean Chalk about 8 years
    Ive re-installed everything, and still nothing. It doesnt spin-up the simulator on the Mac like it used to either. I tried it again with the mac simulator already running and it makes no difference. Such a shame - it was the bit I had really been waiting for (sigh)
  • Dean Chalk
    Dean Chalk about 8 years
    @adamhill - my experience is exactly the same
  • SushiHangover
    SushiHangover about 8 years
    @adamhill Are you also using Visual Studio via a Guest VM of the Mac Host? (or both physical?) If VM, VMware or Parallels?
  • Alan McGovern
    Alan McGovern about 8 years
    @DeanChalk it should work just fine in a VM environment and we do officially support that scenario.
  • Dean Chalk
    Dean Chalk about 8 years
    @AlanMcGovern - has it actually been tested with the latest version of Parllels ? I have looked in all the logs and theres nothing that suggests any issues
  • FilthySlider
    FilthySlider about 8 years
    I'm having the same issue. It doesn't really look like the simulator installs correctly. It just pops up a window that looks like it's about to install something, but then disappears quickly.
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk I added a bunch of notes to the answer concerning setup/issues/Parallels, maybe it will help you.
  • SushiHangover
    SushiHangover about 8 years
    @adamhill I added a bunch of notes to the answer concerning setup/issues/Parallels, maybe it will help you.
  • SushiHangover
    SushiHangover about 8 years
    I added a bunch of notes to my answer, maybe it will help someone.
  • Dean Chalk
    Dean Chalk about 8 years
    I get the Windoiws process but nothing happens and I cant see anything similar in mac console. I don't have any firewals etc. Will reconfigure the networking on the VM as suggested and see if that helps
  • Dean Chalk
    Dean Chalk about 8 years
    "In the Parallels VM (Windows) configuration, add a second network adapter to the Windows guest that is assigned as a Host-Only and use that IP address as the Mac host for Xamarin connections" <- I have added an adapter but have no idea how to get these ip addresses. Can you help ?
  • Dean Chalk
    Dean Chalk about 8 years
    Ive seen another issue, the Mac process Xamarin.Simulator.Server.exe is never running. The simuklator itself is visible on the mac, but that particular process is never running on the mac. Could this be the issue ? - by the way, thanks for all the effort you have put in trying to fix this
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk If Xamarin.Simulator.Server.exe is not running on the Mac, that is your root problem, now the question is what is the "root cause" on that process not being spawned. On Mac, I would kill all the Mono processes, open Console so you can watch errors, over on Windows VM and re-connect to the Mac build agent. As it connects, it will start (try) to start those 5 processes, watch the Console output for errors. Something is failing during the spawn process (firewall issue on the reverse tunnel? bash is not your default shell? (I think this bug is back for this Simulator agent), ....
  • Dean Chalk
    Dean Chalk about 8 years
    Sorry, when I meant that process is not running on the Mac I meant that I wasn't once of the 5 output lines from the command you suggested I run in the Mac console. I have 4 lines returned rather than 5 suggested and the one missing is the line ending in Xamarin.sumulator.server.exe
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk "root cause" on that process not being spawned actually that process should be spawned if on Windows you have selected to use the remote iOS simulator , but is dying or being kill by something. Console output can really help on this one
  • Dean Chalk
    Dean Chalk about 8 years
    I have my windows firewall completely turned off, just so I know it's not part of the problem
  • Dean Chalk
    Dean Chalk about 8 years
    on the console I dont realy know what Im looking for, but I get a lot of these lines - 01/05/2016 10:31:49.206 com.apple.CoreSimulator.CoreSimulatorService[22750]: Requested phone is is not available for pairing. Assuming it has the capability.
  • SushiHangover
    SushiHangover about 8 years
    @DeanChalk Those lines for phone and watch pairing are "valid" and not an issue, but it does mean that the Xamarin.Simulator.Server.exe is at least starting... give me a few and I'll grab a Console output of a valid startup (it is really noisy, but you can compare it to yours....)
  • Dean Chalk
    Dean Chalk about 8 years
    Im still unable to get a secondary network on my VM client that can connect as a mac host, do you happen to have a URL or article link that can help ? thanks so much
  • Santanu Maulik
    Santanu Maulik about 8 years
    Keep in mind that the server process will not show on the mac until you try to start the simulator from windows, at least initially.
  • Dean Chalk
    Dean Chalk about 8 years
    Any update on this ? Ive just taken delivery of a brand new Mac Laptop and have installed everything from scrathc - and this still doesnt work - with no error logs
  • Ismapro
    Ismapro about 8 years
    Using MacInCloud unable to launch the simulator on my PC. I do connect properly to the Mac from VS I do See the Simulator Process on my side but no window. On the Mac side I can't terminate the Mono.Framework processes as mentionned in the answer interrested in any update thanks
  • Bengi Besçeli
    Bengi Besçeli almost 8 years
    Hello I have the same problem, and the checkbox doesn't appear. What should I type to Mac Agent Console? I couldn't get it in your post.