Connect Xamarin on Mac using Visual Studio - macos

I'm trying connect Xamarin on Mac using Visual Studio. The Mac appears on Xamarin User Agent, but when trying to connect i get this message:
Starting Broker 4.0.1.96 in port 51743...
Couldn't connect to macbook-ricardo.local. Please try again.
Disconnected from Mac macbook-ricardo.local (172.19.2.222)
bash: /Users/ricardo.lima/Library/Caches/Xamarin/XMA/Broker/4.0.1.96/Broker.exe: cannot execute binary file
The Mac is enabled to receive remote connection for ricardo.lima
Thanks in advance

Make sure both are on the same version of Xamarin. If you have any trouble take a look at the Connection Troubleshooting: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/

Related

ECONNREFUSED - Cannot connect from Android Studio to a Node.js web app on the same PC

I am developing an app in Android Studio and it makes Http calls to a Node.js web application that I am developing in Visual Studio. All these are on the same Windows 10 PC now.
The Node.js web app is running via Visual Studio 2017 and listening at port 1337. I am able to connect to localhost:1337/ from both Chrome and Edge and verify that the Node.js app is running well. However, from the Android app running in an Android emulator, when trying to connect to localhost:1337/ it got:
Exception: failed to connect to localhost/127.0.0.1 (port 1337): connect failed: ECONNREFUSED (Connection refused)
I disabled the Windows Firewall, but the same problem is still there.
If I deploy the Node.js app to a real web site on AWS, the Android app in the emulator is able to connect to that and work as expected. The downside is that I am unable to step through the Node.js app to debug.
So, on its own, the Node.js app is running fine on my PC and browsers can connect to it. On its own, the Android app is running fine on my PC, and able to connect to the Node.js app on the Internet. The problem is the Android app cannot talk to the Node.js app on the same PC.
Does the problem lie in Visual Studio, Windows or Android Studio?
As said before: localhost (127.0.0.1) is your emulator not your local computer.
check this.
How to connect to my http://localhost web server from Android Emulator in Eclipse
so use either the IP address of your computer or 10.0.2.2, which is a special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)
I think , localhost didn't work from android studio, because from emulator android studio you cannot direct access
you might be use 10.0.2.2 or 10.0.3.2 , may be this can help you
:)
Use your PC IP address. Run ifconfig/ipconfig in terminal/command prompt and look for something like an inet (or whatever looks like an IP address)
Right click on windows icon at extreme bottom left and select windows-shell or cmd and type ipconfig->enter. As it is the same conputer that Node.js is running, use the ipV4 address of ethernet adapter shown, instead of localhost in your app. Hope this helps...

Xamarin Mac Agent Connection issue

I am new to Xamarin, I am having problems connecting from my windows 10 PC to my mac mini. If I disable Windows firewall I can connect but I don't want to leave my firewall turned off. Anyone know what port needs to be opened on the windows machine for the mac agent to communicate with? I tried opening SSH (Port 22), but that didn't help.
Xamarin Firewall Configuration Instructions
Xamarin Mac Agent
To connect Visual Studio to your Mac build host using the Xamarin Mac Agent requires the SSH port to be open. By default this is Port 22.

Xamarin, Windows 10 Parallels and connecting to a MAC based Android Emulator

I am trying to get my Parallels Visual Studio install to talk to the Android Studio Emulators on my MAC (for whatever reason I am struggling to start the windows ones such as Android Player / Microsoft Android Emulator as they ask for Hyper-V or whatever etc).
Also, having it connect to my MAC reduces the need to install emulators on every VM instance.
I have followed the steps in this guide -
https://taco.visualstudio.com/en-us/docs/run-android-emulator-on-osx-using-parallels/
And after I run the putty SSH script to connect to the MAC, I sadly cannot see any emulators using
adb devices
But, if I run from windows command prompt after the script has connected -
adb connect localhost:5555
I then see via
adb devices
List of devices attached
emulator-5554 offline
So it is "sort of" connecting, but the device is registering as offline and I cannot seem to do anything to get it online so that it could finally show up in the Xamarin Visual Studio Device list.
Does anyone have experience of this who could help out? Is this doable for Xamarin Visual Studio?
NOTES
I have tried kill-server / start-server on both machines to no avail to remove the offline
Thank you WickedW, I'm glad it helped!
So the solution is:
I had the same problem and I found that if Xamarin studio is running on Mac, it will block ports 5554 and 5555. Close it, run in Parallels Windows adb kill-server (Visual Studio will restart it) and restart the SSH connection.
Thanks to "bitibi" on -
https://forums.xamarin.com/discussion/comment/249573#Comment_249573
I always had Xamarin Studio open during a working day when trying to fix this, and it was basically blocking the ports, soon as turned off Xamarin Studio and re-tried the process, all started working!!

Can't find Xamarin Build Host

I installed Xamarin platform on my mac. But I can't find the Xamarin build host that and connect it to the Visual Studio on my PC. Does anyone know how to get it?
You have to configure you Mac for remote access: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/#Configuration
The new buildhost is using ssh. It is using UDP broadcasts (mDNS, a.k.a. Bonjour) for advertising itself. In some networks/routers/switches UDP broadcasts are blocked. If you still can't find it, try to use the static ip of your mac.

VS2015 debugging on remote machine, Connection always fails

When follow the tutorial Run Windows Store apps on a remote machine,Visual Studio 2015 can't connect to the remote debugging tools.
VS2015 finds the remote machine, and it can be selected. However when you will try to run the application on the remote machine, the Remote debugger will simply say "Connection from XXX failed".
Neither it, nor visual studio provide any clue as to what happened.
This happens because the tutorial links an old version of remote debugger.Current version can be found at their Download Center.
Up to date guide:
Deploying and debugging Universal Windows Platform (UWP) apps.
It seems to be Microsoft's custom to have multiple, mutually contradictiong versions of the same documentation.

Resources