Debugging a "remote" Android device with Xamarin? - android

So I am needing to do some debugging with Xamarin Android. This wouldn't be such a problem if the emulator wasn't so slow. So, I looked at setting up the x86 emulator, but because I'm running Xamarin within VMWare (host machine is Linux), that won't work. My best bet is to install either the x86 accelerated android, or use something like Android-x86 from my host machine.
How could I get Xamarin to connect to a device that not's running on the same machine though?

It's possible to configure ADB to debug over the network instead of USB. Check out Xamarin's document titled Setup Device for Development, and scroll down to the section titled Connect the Device to Computer for directions on how to do so.

This is pretty basic but have you enabled USB debugging on your Android phone?
http://www.wugfresh.com/faq/how-do-i-enable-usb-debugging-on-android-4-2-the-developer-options-menu-item-is-gone/
follow those instructions if you havent...

Related

Can I connect my physical laptop's usb port with cloud machine? I want to test android apps using android studio

I am using android studio on cloud, and I want to run android emulator but vt-x is disabled by the provider. So now is there any way to run emulator? And can I connect my laptop's usb port with that cloud machine?
Yes, but none of them is easy.
"on cloud" means that it runs on a virtual machine far, far away. Its host machine, by the provider, surely has vt-x, because all recent strong hardware has. But currently it is impossible to emulate a virtual vt-x for a virtual machine, at least for productive environments. This is why you have no access to vt-x on the virtual machine.
Your options:
There are various ways to transfer usb over network. Linux can do that quite easily, but you need Linux both on your cloud VM and on your laptop. There are also various software solutions for windows. The problem with these is the delay. Some USB protocols have strict timing requirements and if your network is slow, the virtual machine might interpret it as faulty hardware.
The Android emulator is a modified Qemu. Android VMs can run even in an unmodified qemu. It will be slow, and hard to finetune, afaik aosp does not even run in it, but lineageos yes (a link: https://android-x86.org). As you have likely no kvm (linux kernel virtualization accelerator), but it would work.
In your case I would try (1), if it does not work, then you need an essentially different solution. For example, you can script the Android Studio to deploy the compiled apk into your phone with network-based adb.

How to enable device option to connect to external device on android studio?

I'm trying to connect my android device to android studio to run flutter but keep having this issue:
The result should be like this:
But instead, I can't open the device option on my android studio:
When I run flutter doctor there is no error and the device I plug in show up.
The machine I'm using is Asus TUF A15 which runs AMD Ryzen 5 4600H processor.
Can anyone please show me the way to enable this option?
Thank you in advance!
Enable developer options and USB debugging on your android device. More information can be found on the Android documentation here.
Plug your phone into your computer with a USB cable. Allow your computer to access your device if prompted.
In your terminal, run flutter devices to verify that Flutter recognizes your devices
Run flutter run to start your Flutter app or use the function available in Android Studio.
You should also try another USB cable, another Android device, or even another USB port on your computer. (Something simple, but can easily get overlooked)

Android device not showing up in eclipse

I've just bought a new Android phone to develop with - its a Vodafone 785 (Smart mini).
I have followed all the instructions, i.e. allow usb debugging/ non market apks etc, however the device is not showing up in eclipse, nor is it showing up if I use the 'adb device' command.
I'm guessing it may be the drivers. Are the drivers needed specific to each phone? If so does anybody know where I may be able to find them, if they have had problems like this before/used this phone for development. Thanks a lot!
First of all, according to the Google Android device documentation, we need to have a Windows USB driver for ADB (Android Debug Bridge). ADB is a method for communicating with Android devices at a level in which development and debugging is possible.
Try this tutorial:-
http://developandroid.blogopogo.com/tag/adb-driver-tutorial/
Download All MTK USB Driver, See if that works and Install the universal android driver.
Ok for anyone else who has this problem with this phone, you need the alcatel usb driver, found here: http://hexamob.com/driversen/driversen-driversen/download-android-usb-drivers-for-alcatel/

Android Chrome remote debuging for VM

I am reading about remote debugging Android devices:
https://developer.chrome.com/devtools/docs/remote-debugging?csw=1
This sounds convenient, if you have an Android device, that is.
What I would like to know is whether it is possible to use this remote debugging feature with a virtual machine running Android.
Per comments on my earlier answer, it seems that an issue with the Android Emulator is its speed.
I've recently come across Genymotion (formerly AndroVM) which is described in more detail at Lifehacker. It appears that it's based on Virtualbox, which is an x86 virtualization software, so it's most likely using the X86 Android port which would be much faster than emulating ARM on X86. You can also install Android X86 from ISO in Virtualbox yourself (see howto).
Other options for speeding up Android emulators:
Intel HAXM: Hardware Accelerated eXecution Manager (article)
BlueStacks App Player (article)
Jar of Beans
Disclaimer: I'm not affiliated with any of these projects, nor have I tried any of them myself so I can't vouch for their quality or compatibility with the ARM-based Android distributions, but from reading about them, folks seem to really like the performance, and development/debugging on such devices should, in theory, easily transfer to ARM-based ones.
You can use remote debugging with the Android Emulator, which is essentially the Android VM you're looking for. If you have performance issues with the emulator, see answers to this question. Alternatively, since your goal is to debug and test mobile websites, consider using Chrome's mobile emulation.
To perform remote debugging of an Android VM (e.g. AVD from Android Studio) running Chrome you can connect from Chrome on your desktop - type in the following url:
chrome://inspect/#devices
There it will list any connected devices - the Chrome running on the Android VM will appear there - where you can control it. For example you can then get it open a specific url and then click on 'inpect' which provides for access to the web dev tools console - just like on desktop Chrome.

Run Android on virtual machine for development

Currently I am using Android emulator for development, but it is very slow. I am looking for some android port that can run on real CPU.
For example I installed this product http://www.android-x86.org/documents/installhowto on VMware, and it seems to work much faster, but I have no idea how to setup network connection here.
The question is if some one is using alternative android setup for development, instead of emulator? If so, a link to configure instructions would be great.
Why not just plug in an Android powered phone? Just set USB debugging on and it acts exactly like the emulator.
I have run the Android-x86 project on my n450 powered netbook and it was unusable. The port is by no means ready for daily use. Basically, if you think the emulator is slow, you will cry when you find out how slow Android-x86 is. My advice would be to throw a few bucks at a newer/faster computer if you think the emulator is slow. I develop on a 3 year old Core2Duo 2.4Ghz notebook and it runs just fine. I've even run the x86 port on the same notebook and it's horribly slow (not to mention not touchscreen). Also, if the network doesn't work 'out of the box', then you'll have to hack the source code and implement your own driver as Android-x86 is meant to work on Asus Eee PCs.
So either upgrade, or plug in your android powered phone and use that.
But for now, I wouldn't bother trying to use the x86 port for development. It's just not ready yet.
Here you can find a tutorial for installing and connecting to the eclipse x86 version.
if you use eclipse, before running your program, run the virtual device from "Android sdk and virtual device manager". surely you will be excited from fast running.
dont forget to increase your device ram in hardware setting section.
When booted, use Alt+F1 to go to terminal.
Enter: netcfg eth0 dhcp
Your network should start and get the Ip, you can check if you run netcfg

Categories

Resources