How to attach Visual Studio 2015 debugger to an android app - android

I have already a tool-chain to build my c++ apps cross platform but it is a mess to debug. It would be nice to attach visual studio to a running app on the device.
Is there anyway to attach the debugger of visual studio 2015 to a running app like to a windows process?
Kindly,
Martin

It's working for me. You don't really say where your app comes from, but I'm using the Native-Activity Application (Android) from the New Project dialog. Run in debug mode and use the normal debugging tools.

Related

Xamarin.Forms Visual Studio 2017 project does not deploy

I am new to Xamarin. I used Xamarin. Forms template to create a sample mobile solution in Visual Studio 2017. The process created four projects Xamarin PCL, Xamarin Android, Xamarin.iOS and Xamarin.UWP. Without making any modification to the generated solution, I am trying to run it.
The first issue is, when I set the UWP as the starting project, the Windows emulator shows up and runs the app perfectly. But when I try to do the same with Android, I get different errors at different times based on the environment changes I make. Finally, using the visual studio android emulator, the Phone UI shows up but not my app. In the background, I can see that Visual Studio completed the build process successfully without any errors but the deploy process simply hangs. I left the deploy running overnight but still running in the morning. Here is my environment.
Intel Core i7 processor
Virtualization enabled in BIOS
Windows 10 Education
32GB RAM
Hyper-V disabled in Windows
Executed bcdedit /set hypervisorlaunchtype off in the command window and rebooted.
I tried setting the above environment in different combinations but none of them seem to make the app work. When I use an android emulator from android SDK, the build process throws errors. The only emulator that even builds is the visual studio emulator. But the deploy hangs.
A second issue I have is, I have installed android SDK for version 24 and 25. But in the emulator dropdown, I can only see the emulators for 23. I checked the installation path both in visual studio and android SDK manager and they both point to the same installation folder. What do I need to make the emulators for version 24 and 25 usable?
I repeat, I did not make any change to the generated solution in visual studio before running it. I have been at it for the past three days and couldn't make it work. Please help.
I just installed Visual Studio 2017 (on Win10 15063.138) and found, like you, Xamarin projects won't deploy to Android. Here's how I got running:
Updated everything in the Android SDK Manager.
Installed the new, improved Android Emulator from MS:
https://www.visualstudio.com/vs/msft-android-emulator/
Used that to download/install an API level 23 (6.0 Marshmallow)
emulator
Started that emulator using the same tool (you'll see it running in Hyper-V Manager)
Selected same emulator in VS for deploy/debug (the emulators that ship with VS are painfully slow)
In VS, selected Android project for start-up and verified build and deploy to Android in build config mgr.
Note: MS doesn't appear to have any emulators above API level 23, so Compilation and Target settings for your Android project can be the latest, but the minimum target will have to be 6.0 (API 23).
After pulling my hair for the past few days, I finally got my Xamarin.Forms Android App to show my page on the emulator. Thanks to all the members for their suggestions. Ryan's suggestion helped a lot ( I +1ed him, thanks Ryan) but did not solve my problem. I googled further and found a suggestion that asked to change the following setting which did it for me finally. So, if anyone else get stuck like I did, please do the following (in addition to cleaning up and updating all packages):
Open up the setting for your Hyper-V vm for your emulator (while the VM is off).
Expand the Processor node on the left and click on "Compatibility".
Now put a check mark on "Migrate to a physical computer with a different processor version" on the right.
Start your emulator in the Visual Studio Emulator tool.
Now, start debug your android project in VS using the same emulator that is already running.
After a delay (there is always a delay), your app will show up on the emulator. Yey!!

Android emulator on VS 2015?

I just installed Visual Studio Community 2015 Update 3 (with Xamarin) from scratch from the 7GB ISO.My aim is to create a blank Xamarin project and run it in an Android emulator.
But in the Start button, I can't even see the device/emulator selections.
I thought Visual Studio comes with an Android emulator.
What am I missing? How can I run it on an emulator?
Not 100% sure with your Visual Studio version but it's an optional feature in Visual Studio Enterprise. I had to choose it specifically to install it. You can go to Programs and Features, choose to change Visual Studio 2015, then choose Modify and add the Android Emulator like this:

Visual Studio 2015 fails to run Android app on some devices

While trying to use Visual Studio 2015 (community edition) to compile and run a simple Android app (the Hello World example you get when you create a new empty Android project in fact) I ran into the apparently well known problem that "run-as" does not work on some Android devices. In fact it does not work on any of those I tried running different versions of KitKat and Lollipop.
After successfully deploying the app, Visual Studio 2015 reports "Unable to start debugging. Android command "run-as" failed. Package com.Android1 is unknown"
I do not want to root the device to change the packages.list attributes, but I can successfully use "am start com.Android1/.Android1" from adb to run the app.
I would therefore like to modify the scripts kicking off the app execution in Visual Studio 2015 to use "am" instead of "run-as", but despite browsing through settings, makefiles, and scripts containing references to "run-as" I could not find where it's done. Is it possible to do it, and how? Or is there an alternative solution that does not require rooting the device?

Visual Studio 2015 missing android emulator

After installing Visual Studio 2015 Preview, I've checked android emulator when second installer prompt, but when I create a new android project, there are no android emulator option with X86, only a start button is exist...
Can anyone please help me to solve this issue?
Update as per comment below: You need Hyper-V enabled on your machine to run the VS Emulator for Android.
Sorry, I cannot tell from your blurry screenshot if this is a C++ or a Cordova or a Xamarin project in VS2015. In any case can you try with the other project type to see if this is a project type issue or an emulator issue?
Also I presume you have all the requirements such as Hyper-V enabled, correct? You can read more about the VS Emulator for Android and its requirements here:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/11/12/introducing-visual-studio-s-emulator-for-android.aspx

how to run eclipse android emulator via visual studio

Hi is it possible to run or communicate eclipse android emulator via MS visual studio?
If yes please help me or state ways how to set up possible solution.
If you are using Mono for Andriod.
We can run the app as usual in Visual Studio by choosing
Debug > Start Without Debugging (or Start Debugging to run with the debugger attached).
or Simply press F5 in your “Mono for Android” Visual Studio project.
Visual Studio will launch the Select Device dialog Selecting Start emulator image in this dialog and it will open a list of available emulators:
When we choose the emulator we want to run and then click OK, Mono for Android launches the emulator. After it starts up, the emulator will appear in the Running devices list
From the Android documentation:
The recommended way to develop an Android application is to use Eclipse with the ADT plugin...
Added new Solution based on the comments
vs-android is intended to provide a collection of scripts and utilities to support integrated development of Android NDK C/C++ software under Microsoft Visual Studio.
Currently vs-android only works under Visual Studio 2010. Earlier versions lack the MSBuild integration with the C/C++ compilation systems.
The only required component is the Android NDK. Neither Cygwin, Java, nor the full Android SDK are needed to compile and link C/C++ code.

Categories

Resources