How to use Xamarin's IOS Remoting Simulator - xamarin

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

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:
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:
After a second or two and some CPU usage spikes on that process and it should appear:
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.

Remote simulating requires enterprise
https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/
Remoted iOS Simulator requires a Visual Studio Enterprise license

Be aware that this is the first release and it is very much still a preview. If you have issues please do reach out via our forums [0], or whatever suits you best.
If you have the just-released alpha versions of everything and it doesn't work, we will need a copy of the log files (on both visual studio and the mac) to diagnose the root of the issue. Either the forums or bugzilla would be best for that.
[0] https://forums.xamarin.com/categories/visual-studio
[1] https://bugzilla.xamarin.com/enter_bug.cgi?product=Windows%20iOS%20Simulator

Open simulator log to see what is the root cause.
%LOCALAPPDATA%\Xamarin\Logs
My log show this error
System.Security.Cryptography.CryptographicException: Key not valid
for use in specified state.
To fix the problem, I delete everything in
%localappdata%\Xamarin\MonoTouch
Disconnect the mac, forget it as well
Re-connect Mac
Itshould work now

Related

Docker on Windows 10 Crashing

I'm on windows 10 and I'm encountering Docker on Windows crashing on startup.
I just installed docker on windows and have a couple of containers spinning up (last night). I've been able to use it but after reboot, or shutdown, this was the behaviour ever since. Pretty unstable.
It looks like this and terminates after a while without any prompt of an error.
More info that I have Hyper-V installed on my machine and "Use the WSL 2 based engine" option enabled on docker.
On my end, I was able to solve this by:
Going to Apps & Features
Search for Ubuntu (or any linux distro you've installed)
Click on it and navigate to Advance options
Click on Reset button.
Also, try to trial and error which docker on windows version is stable with your system.
Hope that helps.

Asus Laptop Unable To Pair With MacBook Air In Visual Studio, "An unexpected error occurred while checking the SSH configuration..."

This is an error I have only observed with the two machines I mention in this issue - an Asus Q406DA AMD Ryzen 5-based laptop running Windows 11 (issue occurred with Windows 10 also) and a MacBook Air running Big Sur (2020 machine). I do not observe this error connecting with Dell desktop systems with Intel processors.
All I'm trying to do is to connect/pair the Windows 11 laptop over a network connection (wireless or ethernet; doesn't matter, symptoms are the same) to the MacBook Air using the "Pair To Mac" feature in the toolbar to allow Xamarin to remotely utilize the Mac as a server for generating executable iOS code and run on an iPhone connected to the MacBook Air.
Upon clicking on the "Pair To Mac" toolbar button, the Pair To Mac dialog window appears, recognizing the MacBook Air on the network at a particular IP address. Double-clicking on the Mac entry, or right-clicking on the entry and clicking "Connect...", or clicking the "Connect..." button in the lower portion of the dialog all produce the same messages in the Xamarin console:
Broker 16.11.000.190 started successfully
Successfully connected to Local Broker
Starting IDB Local Agent...
Checking IDB.Local 16.11.000.190 installation...
Starting IDB.Local 16.11.000.190 in port 56569...
IDB.Local 16.11.000.190 started successfully
Successfully started IDB Local Agent
iTunes has not been found. Please ensure to have a valid iTunes installation in order to communicate with Apple devices in Windows
Apple Provisioning Error: Password for account smallscreensw#hotmail.com was deleted from Keychain. Please remove and add this account again.
SetSelectedDeviceAsync BEST Local Device
Checking host configuration for connecting to '192.168.1.32'...
Checking SSH configuration...
Checking host configuration for connecting to '192.168.1.32'...
Starting disconnection from 192.168.1.32...
Starting disconnection from 192.168.1.32...
The connection to '192.168.1.32' has been finished
An unexpected error occurred while checking the SSH configuration of '192.168.1.32:22'
I have tried updating the Mac, updating Visual Studio (it happens for 2019, 2022 Preview and 2022 Release Candidate versions), trying an ethernet connection instead of wireless (it happens both ways), rebooting both systems, and even changing out the hard drive.
The interesting thing about this problem is that it didn't use to happen. I had a 2012 MacBook (the lower-level Mac notebook with the white body) and never had an issue connecting until I switched to a 2020 MacBook Air running Big Sur. (The 2012 MacBook originally had Snow Leopard, then was upgraded to Mountain Lion, Yosemite, High Sierra, Mojave and Catalina (the last version of OS X available for this backlevel machine.) I never observed this issue with any of the other versions of OS X, although over time, performance began to bog down until it was more or less impractical (spurring the purchase of the new Big Sur machine).
I have absolutely no idea as to what may be happening. My first thought was maybe it's an AMD vs Intel chip thing but, as I stated, I have been able to use "Pair To Mac" before. I have never had issues with pinging to check for network connectivity (never any lost packets), and can manually run an SSH command in a terminal window on either system. I even went to the point of creating a special rule for the particular IP address at which the Mac is connected to allow incoming and outgoing connections (the pair operation apparently happens at port 22 but the rule allows all ports without distinction).
As a workaround I copy the Xamarin code (C#, XAML, etc.) directly to the Mac and work with Visual Studio for Mac, but I'd rather be doing this from the Windows laptop with the MacBook Air functioning as the server.
I searched online for similar conditions other users have experienced, but never saw anything matching this, hence my opening this problem ticket.
To aid in diagnosing the root cause of this problem/bug, I have created a OneDrive folder at this publicly available URL (read-only mode):
https://1drv.ms/u/s!AuAciPLtk4WAhwSRexATUxGZbFQj?e=32b3CN
Here's what's in the folder:
Asus Laptop Specifications.txt
A system report on the state of the Windows laptop at the time the condition occurred.
MacBook Air Laptop Specifications.txt
A system report on the state of the Mac OS laptop at the time the condition occurred.
Screenshot SSH failure Image_20211107_013742.png
An image of the failure messages from Xamarin in Visual Studio.
Xamarin Output Messages.txt
The output messages from the above screenshot, in text form.
Unexpected SSH error connecting with MacAgent in Visual Studio Video_20211107_014021.mp4
A short video demonstrating the condition and the ensuing error message.
Xamarin Forms is a fine product, but this is a real head-scratcher.
THANKS!!!!
I seem to get the An unexpected error occurred while checking the SSH configuration error when trying to pair VS 2022 to a Mac whenever I update the network password on my PC.
The following steps (based on a combination of different suggestions in this VS community post) have worked for me to get rid of this error:
Exit all instances of VS.
Delete everything from these 2 folders on the PC:
%LOCALAPPDATA%\Temp\Xamarin
%LOCALAPPDATA%\Xamarin\MonoTouch
Open VS and attempt to pair with the Mac.
a. You will be prompted for your Mac username and password.
b. The first pair attempt may fail. Wait a few seconds and try to pair again.
The above steps work with both the Xamarin version of VS 2022 and the MAUI preview version of VS 2022.

Cannot run Xamarin.iOS apps on macbook from Windows Parallels (cannot install Broker)

I am trying to build a Xamarin iOS app and debug it in my mac simulator from Windows. I haven't been able to get this working all day and it is pretty time sensitive at this point.
I have updated and ensured both VS mac and windows are on the same update channels, have the same versions of Xamarin installed, cleared the cache on both mac and windows, made sure I can SSH into my machine, I can actually run the mac agent on a remote machine over VPN, but the connection is EXTREMELY slow and it is causing all sorts of different issues so debugging with it isn't an option.
The only thing I've noticed is that everyone else who seems to have this issue and shares info from their Xamarin diagnostic output shows that they're installing from Broker 4.6.* while mine seems to be trying to install Broker 1.1.6.*. This seems pretty odd, but I don't really know anything about this as I have nearly zero background in Xamarin and have just picked up this project as my company's Xamarin dev left last summer and I am developing a NativeScript app for us... someone thought they were kind of similar I guess?
Anyway, here is my output from when I attempt to connect... lastly, I used my mac's IP because the windows parallels install couldn't resolve the machine name and pointing localhost or 127.0.0.1 doesn't seem to work either although I'm not entirely sure why.
Checking host configuration for connecting to '192.168.86.29'...
Checking SSH configuration...
Checking available disk space...
Checking Mono installation...
The required Mono version to install on the Mac couldn't be determined, so the Mono validation will not continue.
Checking Xamarin iOS installation...
The required Xamarin.iOS version to install on the Mac couldn't be determined, so the Xamarin.iOS validation will not continue.
Checking host configuration for connecting to '192.168.86.29'...
Host '192.168.86.29' is configured correctly
Starting connection to '192.168.86.29'...
Installing Broker 1.1.6.181...
Unable to install the Broker
Starting connection to '192.168.86.29'...
Starting disconnection from 192.168.86.29...
Starting disconnection from 192.168.86.29...
The connection to '192.168.86.29' has been finished
An error occurred while trying to start the Broker...

Android Studio on Mac OS X adb connection

I'm using Android Studio (1.0.2) on Mac OS X (10.10.2). I can use Eclipse with adb with no problems on my system. However, Android Studio has problems connecting to adb. The first run it works. It seems that after a certain amount of time (20 - 30 secs?) adb quits unexpectedly. Then I get the message ADB not respoding in Android Studio. Manually killing and starting adb from a terminal sometimes fixes the problem but usually makes my device (Samsung Galaxy S5) invisible to adb. There is only one adb on my system (version 1.0.32) installed.
Doing an lsof -i :5037 shows a list of 9 connections from Android Studio, all from localhost, all CLOSE_WAIT but one which is ESTABLISHED. In a working situation there are also four of them from adb, one of them LISTENING on port 5037.
I have my firewall turned off. Exiting Android Studio crashes adb one more time. Restarting it sometimes allows me to continue working, sometimes it changes nothing.
Unplugging and plugging back in my device fixes the device visibility.
Please advice what to try next because this setup is pretty unusable at the moment.

Can't connect to Xamarin.iOS running on Mac from Windows machine

The diagnostic view fails in the third-to-last step (out of 11):
Establishing a stateful connection to Mac build host via HTTP. => failed
The Details section shows:
Connection could not be established. Unable to get InfoRecord. Unable to get SDK status.
I have double checked all recommendations in the "Actions" section: latest version of Xamarin.iOS installed, no other instance of Visual Studio connected, firewall disabled, Xamarin.iOS activated.
Both machines have Xamarin Studio 4.0.
Here are the last few entries from ~/Library/logs/Xamarin/MonoTouchVS/mtbserver.log:
[01-Mar-2013 17:52:24] Server IP Address : 10.1.0.199
[01-Mar-2013 17:54:44] mtbserver: No KEEPALIVE command, exiting...
[01-Mar-2013 17:54:48] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
[01-Mar-2013 17:54:48] Server IP Address : 10.1.0.199
EDIT
As mentioned by Veux below, using a proxy on Windows can cause this issue. Curiously, Fiddler2 can still work as a reverse proxy for the device (iPhone or the simulator) if "Capture Traffic" is disabled.
I had the some problem, all was configured well but got the same error.
The solution for me, was to disable the proxy! on the windows machine
Hope that will help you
Check if you have Xcode installed on /Applications/Xcode.app
Check if the Documentation of Xcode is installed.(http://screencast.com/t/f3Kku2iggDeY)
Check if this path exist on your Mac.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/
If is empty, create a symbolic link from DocSets (http://screencast.com/t/dmN00AYw9k)
~/Library/Developer/Shared/Documentation/
to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets

Resources