Connecting my Android device with Visual Studio 2015 RC - android

I have compiled a sample Android project with Visual Studio 2015 (RC - Community Edition), now I would like to deploy and execute it on my connected android device.
ADB seems to be working:
"adb devices" is showing my device "CB5A1N42TN device"
using the menu "Tools / Android / Android Devices Monitor" tools I am able to see the connected device
in Android Studio, I am able to deploy and run my app on the device
But in Visual Studio 2015, when executing the project I have the following error message:
1>Error installing the package. The device '' is invalid or not running. <...>
So I suppose I should input my device somewhere, but I can't find that place in the options available.
I also noticed that on the dropdown menu for the execution there is a "No devices available" message.
Thanks for your help.

Ok I found the answer , hopefully it will help others.
The configuration was pointing to "X86", once I selected "ARM" then the device appeared in the list of targets I could run the app on.

Go to the Settings screen in your android phone
Select Developer options
most importantly make sure USB debugging option is checked
hopefully your USB drivers are installed and for further details go to this page

Related

Visual Studio 2022 Android Device not found

I am using Visual Studio 2022 to create a Xamarin.Forms application based on Android. Now I have the problem that my connected Android device is not recognized in Visual Studio. Running "adb devices" shows the connected device. When running Android Studio I can also see the device listed - only in Visual Studio it is not shown in the list. In addition, also the Windows Device manager shows the the device in the portable devices category.
I have enabled USB Debugging on the device
I tried different cables
Reset the USB authorization for the connected PC
Any idea what's wrong here?
Search for Visual Studio Installer from your Start menu.
Select more->repair. Use this operation to try to repair.
You can also try other Android devices to check, if it still doesn't work, please check your Android SDK.

Android Studio doesn't recognize device on MacOS even though adb recognizes it

Hi I am running Mac OS 10.15.3 and I wanna debug my app from Android Studio 3.6.1 to my Nexus 5. But Android Studio for for some reason doesn't recognize device even though if I run adb devices it lists my device and says that it is connected. I checked USB settings in phone and I enabled debugging and tried setting MTP and PTP. Also in Android Studio under "Device File Explorer" I see error message saying:
"Error Initializing ADB: Android Debug Bridge not found.
Even though it is installed and I can issue adb commands through terminal.
Did anyone had this issue with MacOS and Android Studio ?
This problem is related to the last update of Android Studio. Check this:
https://stackoverflow.com/a/60872065/8083220.
You can check if the tools are up to date.
Find this icon in the top-right of Android Studio.
It opens Android SDK menu. Now, click on the SDK Tools pane.
Update all the outdated tools that you can and retry.
I now this is not the best answer but give it a try.

No USB devices or running emulators detected in IntelliJ

I have clicked on my Samsung Galaxy build number seven times and got a message, that I am a developer now. I connected this device to my computer via USB. I have installed Android SDK and created a sample project in IntelliJ.
But when I try to run it, the following window appears:
Troubleshoot link does not work.
What else was I to do in order to be able to run Android programs from IntelliJ?
You need to enable USB debugging in developer options. Like on image below

Issues after installing Xamarin

I got a new laptop this week (Win10), installed Visual Studio 2015 community, followed by Xamarin. I've created a blank Android project, uncommented the SetContentView(...) line in MainActivity.cs, then build the solution. However I'm running into various problems when I try to run it:
The list of emulators (next to the green "run" button) only contains two entries: "Android_accelarated_x86 (Android 6.0 - API 23)" and "Android_ARMv7a (Android 6.0 - API 23)". Is this normal? The Xamarin doc'n seems to suggest that a number of "Xamarin xxx" emulators would be installed.
When I run the project against "Android_accelarated_x86", the emulator starts up, Visual Studio reports the deployment is successful, but Visual Studio stops debugging. In the output window I see this:
InspectorDebugSession(0): StateChange: Start -> EntryPointBreakpointRegistered
InspectorDebugSession(0): Constructed
Android application is debugging.
Couldn't connect to logcat, GetProcessId returned: 0
InspectorDebugSession(0): HandleTargetEvent: TargetExited
InspectorDebugSession(0): Disposed
If I hit run again, the app seems to start on the emulator, but then a message appears saying "Unfortunately xxx has stopped" (where xxx is my project name). The above messages appear in the VS windows again (apart from the one about 'Couldn't connect to logcat...').
I've also noticed that the "Manage Virtual Devices" item in the dropdown is greyed out, so I presumably can't try creating a different emulator?
Shooting from the hip on this one but do you have the Android SDK installed? It should install a number of other emulators and give you access to the device manager.
There are emulators you can INstal with Visual Studio. Emulators that come with the Android SDK and emulators that install with Xamarin Studio.
One additional thing to try would be to install Xamarin Studios. It does a slightly better job in my experience of setting up your environment then VS Does.
Firstly, the Manage Virtual Devices is referring to Xamarin Android Player VMs (which is now deprecated). We're working on getting this removed if Xamarin Android Player isn't present.
To create / edit / fix your Google AVD VMs you should select Android Emulator Manager. Regarding the number of devices listed, I'd probably ensure everything Xamarin is updated..
Visual Studio > Tools > Options > Xamarin > Other > Check for Updates
..and also update all your SDK components. If you have an Intel CPU you should use the x86 images for best performance. If you haven't already installed this you can get it here:
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
If you update any images it could be that your AVD needs repairing, which you can do in the Android Emulator Manager by selecting the relevant image and clicking Repair.
Also, you will only be able to deploy to devices that your project is targeting, so it's worthwhile checking the AndroidManifest.xml or by right-clicking your project and checking the 'minimum' and 'target' Android API levels to ensure you're encompassing the AVDs you have created.

Android Studio doesn't start with connected device

I have installed Android Studio v0.1 on Mac. My project imported and built successfully. AVD shows up whenever I run or debug the project, even though my device is connected and shown in integrated DDMS. I have double checked with adb devices from command-line and it shows my connected device. Please help~
// the very First time it will always selected only emulator options
you need to change it in Create Run Configuration...
in that General Tab select Target Device
Show chooser dialog
USB Devices
Emulator
Visual aid to #Padma Kumar's answer.
"Android Studio is not starting from Device", "Force to start Android Studio from Device"

Categories

Resources