1

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.

Rolf
  • 5,550
  • 5
  • 41
  • 61

3 Answers3

1

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.

Community
  • 1
  • 1
Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
  • I'm still trying to get this to work but I'm pretty sure that this does not come with access to the android browser console, which is what I'm trying to access without having a device. Am I right or wrong? – Rolf May 24 '14 at 21:42
  • Thanks for the tip. Actually the emulator shows in the device list in the Chrome remote inspect view, so it might actually work! That would be great. Now if this javacrap powered emulator VM would boot in like less than 1/4 of an hour maybe I will be able to confirm whether it works or not tonight. – Rolf May 25 '14 at 00:14
  • That works indeed but it's way too slow to be usable. I have accepted this answer nevertheless because it answers my question. I'll change the accepted answer to another answer if another better solution is proposed: eg: an android VM that would be fast enough to be usable for testing (and with remote browser console access). I have tried to make the Android Emulator faster with things such as using x86 Atom code and enabling Intel HAXM and enabling GPU acceleration. I've given up of it. – Rolf May 25 '14 at 14:27
  • 1
    Have you looked at the suggestions in [this question](http://stackoverflow.com/q/1554099/3618671)? There are also some relevant links if you search for [speeding up android emulator](https://www.google.com/search?q=speeding+up+android+emulator) on Google, but haven't tried them myself (and they're likely to be already represented in the SO answer). Hope this helps. – Misha Brukman May 25 '14 at 15:35
  • Also, if your goal is to debug/test a website on a mobile device, maybe an easier and faster way is to use Chrome's [mobile emulation](https://developer.chrome.com/devtools/docs/mobile-emulation). – Misha Brukman May 25 '14 at 16:33
  • 1
    @Rolf I've recently come across some additional options which may help solve the performance problem. See my other answer to this question below. – Misha Brukman Jul 27 '14 at 16:25
1

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:

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.

Community
  • 1
  • 1
Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
  • Thanks. I am already using Genymotion as my solution. I don't think I managed to have remote debugging work with that, for some reason, but at least I have a working and stable Android system to test it on. I've gotten rid of the official ADK bloat. Yes, I've tried HAXM and all the other stuff and lost days on it and honestly I don't recommend to anyone to loose their time on this crap. I actually recommend against buying anything Android but that's off topic. Anyway, marking your answer as accepted answer since I didn't bother writing one myself. – Rolf Jul 28 '14 at 18:05
  • PS: Bluestacks works as well, but I couldn't manage to update their browser - the one they use by default seems to be outdated. Plus they have annoying nag screens asking you to register to stuff. It is geared towards gamers and not that friendly to developers after all. – Rolf Jul 28 '14 at 18:07
  • PS2: Jar of Beans seems to be discontinued. So the only effective tip in your post would be Genymotion. – Rolf Jul 28 '14 at 18:12
1

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.

Pierz
  • 7,064
  • 52
  • 59