An alternative to using the Xamarin Remote iOS Simulator in Visual Studio.
I haven't really been doing a lot of Arduino programming lately, instead I've been working on building a new cross-platform app using Xamarin Forms in Visual Studio 2019. When I started, Microsoft had problems with the running the Remote iOS Simulator on Windows and I had found an alternative that worked well for me. In fact, now that the Remote iOS Simulator support is working again, I've found that I actually prefer my alternative because it's substantially faster (i.e. it doesn't shut down the simulator on the Mac when I stop debugging so I don't have to wait for the simulator to start every time I want to test an app), and to be honest, I find it is just about as convenient. So, I thought I'd share what I do and how I do it. What will you need? First, you will need 2 Microsoft Windows-based Computers along with a Mac that is compatible with the XCode Version need for Xamarin development ...yes, that's one more Windows Computer than what is required normally (Note: It may be possible to do it with a single multi-monitor computer too). You will also need TightVNC (both server and client) and you will optionally need a utility called TurboTop (or similar).
Setup:
1- Install TightVNC (both Server and Client) on your Second Windows Computer (you won't actually be doing any development on this computer, it's just used to connect to the Mac using TightVNC Viewer, and your Development Computer will connect to this computer).
2 - Connect to the Mac using Tight VNCViewer on the Second Windows Computer (I have it setup to run at a scale where it can run in a Window, but can still see the whole Mac Display).
3 - Now start the iOS Simulator on the Mac (start whichever Device you wish to test with), also move and size it to your preferences.
4 - Now in the TightVNC Server setup another port to only show the simulator window. In my case, since I have 5900 setup as a scrollable dual monitor option, 5901 as just the primary monitor and 5902 as just the secondary monitor. The next port available for an iPhone 8 simulated device is 5903. The Port and Geometry Specification below may not work for you (or the device you are simulating), but this gives you an idea of what I am using.
5 - On your development computer you will need TightVNC Viewer and (optionally) the TurboTop utility (which allows a window to always be on top of other windows).
6 - Now, if you run TightVNC and connect to the Second Windows Computer on the port the Simulator Window is defined for (again, the port # is 5903, so I will either launch with ComputerName::5903 or IPAddress::5903. 5900 is the default and doesn't need to be specified with the ::Port# option) you will see the simulator and can use it while testing your application in Visual Studio (and optionally even force it on top with the TurboTop utility). You can also even scale the VNC Viewer window it to be the size that works for you (also, optionally save a file with the configuration and pin it to the Task Bar with the TightVNC Viewer Icon in Windows 10 (If you save the password when prompted, you won't even have to login), and it will be easy to launch anytime you need it).
Also, if you want to you can add as many other VNC Server Ports with the correct dimensions for other iOS Devices on the VNC Server on the Second Windows Computer and easily use while developing for those iOS Devices. Remember to turn off the 'Remote Simulator to Windows' in the Visual Studio Xamarin iOS Settings if you decide to use this method for developing with the iOS Simulator on your Mac.
One final thought, you can connect to ports thru VNC Viewer to a VNC Server on the same computer. So, if you have a multi-monitor system, you could successfully find a workable solution with only a single windows computer. It will probably look a bit weird on first launch of the area that shows only the simulated device, but after you move the device view window off from the area that is being displayed from the full-screen view (i.e. to a different monitor), it may be totally usable. For example, keep the full screen Mac view on one monitor and Visual Studio and the device view on another. With the ability to keep the device view on top, it might (probably would) work reasonably well.
Comments
Post a Comment