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

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!!

Related

Visual Studio: Failed to Deploy to HoloLens 1 (DEP6957)

Been trying to deploy one of my projects onto the Microsoft HoloLens 1 via USB. For some reason, I keep getting an error about remote authentication: "DEP6957: Failed to connect to device '127.0.0.1' using Universal Authentication. Please verify the correct remote authentication mode.. etc."
I'm using Bootcamp on a Macbook Pro + HoloLens 1 with Visual Studio 2019.
Things I've done:
Developer Settings on Both HoloLens1 and Laptop.
Clean/Rebuild solution.
Pair HoloLens to Laptop with the Microsoft HoloLens desktop app.
Selected x86 & Debug with deploy to DEVICE.
Both devices on same Wifi network.
HoloLens connected via usb.
Really hoping someone can help! I've gone through most of the forums online and they all say more or less the same things which I've already done. I've attached some screenshots as well.
UPDATE: Installed the USB Device connectivity on Visual Studio and am still getting the same errors.
We think this issue may happen due to the lack of USB Device connectivity component in Visual Studio and the following steps worth trying for you.
Check if the component USB Device connectivity has been installed for your VS. If not installed, you can install it with Visual Studio Installer.
Unpair all devices in Setting from your HoloLens.
Deploy your project to your device, the first time Visual Studio deploys it, you will be prompted for a PIN. Follow the Pairing your device instructions.

Cannot launch Android Emulator visual studio 2019

After installing windows 10 update whenever launching an android emulator I get
Could anybody advice what do to? How do you reinstall the sdk,remove it
many thanks
Try the obvious first - restart the Visual Studio and the PC.
If that doesn't work then try selecting Tools->Android->Android Device Manager and play around from there. Try creating a new instance of a different device. Google Pixel or Nexus for example.
Try different options from there.

Deploying UWP app from Visual Studio to Windows 10 Phone requires PIN

I'm developing a UWP app for Windows 10 Phone. Since some days when I try to deploy the app from within Visual Studio I get asked for a PIN in order to connect to the device
In the phone settings I can trigger pairing so a new PIN is generated for me. But when I enter that PIN, a new dialog appears telling that the PIN was wrong:
If I press 'Cancel' then the deployment is interrupted with an error message:
1>Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device '30F105C9-681E-420b-A277-7C086EAD8A4E'.':
It's strange but some days ago I was not asked for the PIN when I deployed the app. :-( So currently the only option I have is deploy via the web portal. This works but it's enormously slow :-(
Can someone tell me how to solve the problem or what PIN should I enter in order to achieve the deployment?
I had this problem today, closing visual studio and restarting IpOverUSB service fixed this issue for me.
You might want to take a look at Ricardo Pieper Question he has listed all the things he tried to do and all the things that might work.
It looks like the problem was caused by the fact that I'm developing inside a virtual machine (VMWare Fusion on Mac). After setting up the development ebvironment on a PC the deployment works fine.
I can even debug the app running on the phone from inside Visual Studio.
Here's a solution which worked for me:
I had the same problem on my Macbook running VMWare Fusion and trying to debug on my Lumia 950 phone. I was nearly giving up, then I tried using the free VirtualBox and with a virtual USB 3.0 port (which requires the VB extension pack). And it worked!!
Here's my setup:
VirtualBox 5.0.14
VB Extension Pack
Win 10 Development VM from Microsoft – the VirtualBox variant, Build 201601: https://dev.windows.com/en-us/downloads/virtual-machines
Lumia 950 with Windows 10 Mobile 10.0.10586.29
In the VM, I configured to use the USB 3.0 port, since with USB 1.x the phone device driver could not be installed by Windows 10.
The VM contains Visual Studio 2015; I created a UWP JavaScript application and ran it with "Debug" on the connected Lumia device.
Had to go to the Developer options on the device.
Switch back to "Windows Store Apps" option, and then back to "Developer Mode"

Why doesn't Visual Studio Emulator for Android launch anymore?

I'm using Visual Studio 2015 Enterprise with the new Android Emulator. It worked pretty well for a while but suddenly it stopped working.
The output in VS shows always this:
1>Starting emulator: VS Emulator 5.1" Lollipop (5.1.1) XXHDPI Phone
1>Validating emulator arguments...
1>Determining if emulator is already running...
1>Preparing virtual machine...
1>Launching emulator...
The emulator window appears but it stucks on the black "Loading..." screen. I see in the taskmanager that xde.exe is consuming between 25% and 32% of CPU power. There are no entries in the Windows eventlog telling anything about xde or Hyper-V.
I've already deleted all virtual computers in the Hyper-V-Manager as suggested by Microsoft on the Troubleshooting the Visual Studio Emulator for Android page.
Has anyone an idea how to get the emulator running again?
If you face the same problem then you can try to solve it by these steps:
1. Delete all virtual switches
Try it the way John Kemnetz told in his answer:
Go to Hyper-V Manager, and delete all virtual switches via the Virtual
Switch Manager 2) In Hyper-V Manager, delete all VMs. 3) Restart the
computer. 4) Start an emulator.
2. Disable network interfaces
If this doesn't work then try to do it the way Jason Smith described in a comment:
disable the network interfaces except the windows phone vswitch. Then
once the emulator is booted, turn it back on. If you delete them Xde
will recreate them, you want them created but disabled in the control
panel. The only thing to leave enabled is the windows phone one.
In case this doesn't work neither (which was my case) then
3. Reinstall Visual Studio 2015 Emulator for Android
Uninstall the emulator, reboot the PC and install it again. This worked for me. But I suggest to try the other two options first as the third option can be really time consuming.
Try this:
Go to Hyper-V Manager, and delete all virtual switches via the Virtual Switch Manager
In Hyper-V Manager, delete all VMs.
Restart the computer.
Start an emulator.
Windows 10 updates for some computers are causing problems with virtual switches and they need to be recreated by the emulator from scratch.

How do I attach to an app running inside the Windows Phone emulator?

I'm trying to debug an app running inside the windows phone 7 emulator, but I can't connect to it from visual studio - Attach to Process -> selecting Windows Phone 7 Emulator transport displays an error:
"Unable to connect to 'Windows Phone 7 Emulator'. Not implemented"
What am I missing?
As a workaround:
open the solution configuration manager
next to build is a deploy column, uncheck your project
press F5
This will launch the app that is already on the device without overwriting it (and deleting its storage).
I don't think it's possible to connect to an app that is already running on the emulator.
It sounds like you're trying to connect to the emulator directly yourself,rather than the app running in it. Which I don't think is what you want anyway.
It may help if you think of the emulator as a virtual machine. That's what it is. (near enough.)
If you want to debug an app in the emulator, you need to launch it through Visual Studio.

Resources