Debug with remote android emulator in visual studio - android

my system which I develop MAUI on is not enough for running android emulator, so I decided to run android emulator on another Computer and debug my project remotely on it, I use this help to make a connection between computers, then when I build my project to debug it, visual studio recognize the emulator, install the app on it, and shows the splash screen, but after some minute, it shows this error and debuger agent can not connect:
[monodroid-debug] Trying to initialize the debugger with options:
--debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:36845,embedding=1
[mono] debugger-agent: Unable to connect to 10.0.2.2:36845
I should notice that the port is random
in this documentation of developer.android it shows that
10.0.2.2 is Special alias to your host loopback interface (127.0.0.1 on your development machine)
how should I fix it to can debug remotely in my development machine?

Related

How to debug android devices in remote desktop in xamarin?

I need to find out how we can debug in xamarin using remote desktop.
I have xamarin installed in my remote machine and my scenario is, I will be using physical device in my local windows machine.
So if I connect the android device in my local machine, it should get detected in my remote desktop and I can also able to debug. How we can achieve this?
Thanks,
How to debug android devices in remote desktop in xamarin?
I am afraid that you cannot get what you want for Visual Studio 2015.
For VS2015, remote debugger cannot debug Xamarin projects.
However, if you have VS2017 or VS2019, you can use RevDeBug VS extension to debug your xamarin project remotely.
You can refer to this tutorial.

Cannot start debugging: Cannot connect to 127.0.0.1:29308

I'm developing a Xamarin Form app in Visual Studio installed in a VM created with Hyper-V. With ADB and port forwarding (https://bitbucket.org/chabernac/adbportforward/wiki/Home) I connect my physical device to VM in wi-fi mode.
Visual studio in VM see correctly the device but when i start debugging, the app is installed correctly in my device but debug crashes when app is going to open. The output of Visual Studio is:
Cannot start debugging: Cannot connect to 127.0.0.1:29308: No connection could be made because the target machine actively refused it 127.0.0.1:29309
Couldn't connect debugger. You can see more details in Xamarin Diagnostic output and the full exception on logs.
On Xamarin Diagnostic output can't see anything that can make me understand what the problem could be.
Can you help me? Thanks
You must update SDK Platform Tools at latest.

How can Android Studio recognize devices connected to a remote computer

I want to be able to create Android-Apps on my very old laptop. Since it can't run Android Studio I figured I could run it on my home computer and use RDS to access the PC with the laptop.
Now the problem was how to connect my Phone to my laptop and have it recognized by Android Studio on the PC. Since my laptop is in the same network as my PC (VPN) I managed to replicate this solution. I can run adb devices (since I've set the environment variable ANDROID_ADB_SERVER_ADDRESS I don't need the -H-flag) in the terminal and get my phone in the resulting list. However, when I try running the app in Android Studio no device is found.
So I am thinking that Android Studio uses an integrated ADB that ignores environment variables or some commands that don't support remote usage. Does anyone have an idea what I can do to have my Phone recognized by Android Studio and not just by adb on the PC? I don't want to manually load and start my apps every time I debug.

Xamarin installed in visual studio 2015 and Android Emulator failed to load

I have installed Xamarin in Visual studio 2015 and I have android and ios application within same solution file. when I am trying run android project in my local machine, I got error 'click retry to run the emulator in elevated mode. you do not have permission to modify internal Hyper-V network adapter settings,which are required to run the emulator'. So I clicked on "Retry" - it said windows packages changed to machine and I click on 'Yes', after that my local machine internet connection was gone. with the help of network engineer,Internet connection came back, my question is how can I run android application to my local machine without Hyper-V error.
I am a .Net developer and learning Mobile Application development, please can you help me out and suggest me that what I need to do?.
Thanks.
You did the right thing by retrying emulator in elevator mode, That is supposed to create internal switches to run your emulator and set up internet connection for it. Shouldn't affect your internet connection.
I'll advice
1. Try running the emulator again and let it create the adapters as Visual studio android emulators run in Hyper V.
Test app with a physical device connected to your computer

Genymotion Android Emulator Plugin for Mosync IDE

i've been trying to develop an Android application for some time now but the problem i keep facing is finding a suitable emulator to run a demo of the application (I think the default Android SDK emulator is crap). Anyway i did some research and came across the genymotion android emulator which is faster than any other emulators i have tired so far. I then went on to search for a plugin for my Mosync IDE which is an IDE built on eclipse that allows you to develop native, web or hybrid apps using htnl5, css, javscript, c/c++. Anyway i installed the plugin with the MosyncIDE the same way you install any new software in any eclipse based IDE and it installed fine. The problem i have now is that i am able to run the emulator okay but when i try to run my application inside that emulator i am unable to locate the genymotion virtual device in the list. I have been fiddling with my configuratin settings for days now without any results, i do not own an android phone so testing it directly on one is not an option for me, i would like someone to help me out with this problem thank you.
Please note that i am able to run the app normally with the default androidsdk emulator.
[What i have been trying soo far]
This is what i do currently, i start the genymotion emulator within the IDE.
I go to run configurations.
I choose Android Emulator.
I hit "Refresh AVD list"
Then i choose the android emulator i want from the list, the problem is i can't find the
genymotion emulator i started within that list.
Ok. The thing is that Genymotion device is not considered as an emulator but like a real device plugged on USB. You won't find it on the AVDs list but on the "running Android devices".
You first have to check if the running Genymotion VM is connected TO ADB: Run adb devices on a console. It should show you something like this:
List of devices attached
192.168.56.101:5555 device
The Genymotion device is shown as it's IP address.
If the Genymotion device is shown on this list, it should also appear on the list of available devices when you hit the "run" button of your IDE. Like in this picture (done with Eclipse IDE).
If it is not shown on the list, read my previous answer.
So you installed the Genymotion Eclipse plugin isn't it?
And it seems that adb devices does sometimes not display your Genymotion device.
When the VM boots into the Genymotion player, it executes:
adb connect <VM's IP address>
This connects the device to adb, so you are able to debug your apps with it.
Sometimes, it appears that the connection is lost and you have to run adb connect <VM's IP address> again. You have to do it manually for now.
You can get the IP of your running device using the Genymotion Shell with the command devices list

Categories

Resources