Android: Faster debugging emulator for development with Android x86

If you're doing Android dev, most likely you're working on a computer with an x86 compatible CPU.

Unfortunately the older versions of Android SDK images (including 2.3, still one of the most popular in the play store at time of writing) are optimised for ARM chips. The ARM optimised commands are run in the emulator and then translated into x86 commands. This is very slow, but you since you're reading this you already know that.

Even with the Intel chipset improvements from Icecream Sandwich onwards, the emulator still leaves much to be desired in terms of performance.

Android x86, as the name suggests, was originally made to run Android on x86 computers. A wonderful side-effect of this is that it runs incredibly fast in a virtual machine compared to the standard Android emulator.

Gk1Ew
Amazingly fast!

And getting it to work for debugging isn't that hard either.

Setup

  • Grab a copy of Android X86. There seems to be customised builds, but the EEEPC Asus ones worked fine for me.
  • Download and install VirtualBox.
  • Create a new virtual machine (VM)
  • Give it a name, select "Other" for type and "Other/Unknown" for version.
  • You can match what you want to your phone/tablet specs such as memory/space (1GB memory is nice and zippy)
  • Go to Settings
  • Click on Motherboard
  • Under Bootloader, disable Floppy. Move HDD above CD.
  • Under Storage, click on the "Empty" CD icon and then the other CD icon on the right.

image

  • Find and choose your Android x86 ISO file.
  • OK to save.
  • Fire it up and you'll come to an option screen. Select Installation.

AND1

  • Create/modify devices
  • New, Primary, press enter (to use 100% of the space)
  • Bootable, Write, type "yes" and press Enter
  • When it's done, Quit
  • Select sda1
  • Select EXT3
  • Yes to GRUB
  • Choose yes or no for allowing /system to be writable. It's really up to you and how you wish to use the VM. It doesn't take very long to install anyway.
  • Once you're done, reboot.
  • It should now show you 3 options; HDPI, MDPI and Debug. That's when you know it's working!
  • Select any of them and enjoy developing for Android at a much faster rate!

Once it's up and running, reboot it (just to see how fast it starts). No more waiting for snapshots to load!

Tweaking

Now for some stuff to help you get started with Android dev.

You'll need to connect your Eclipse Android SDK debugger to the VM, and to do that you'll need to set up port forwarding on the VM.

By default it's a fairly generous tablet sized screen. For phone development, you can change the screen orientation to portrait orientation.

Caveats

There's no way of sugar coating this. In trade for the speed and performance you get with this method of debugging, you lose the ability to rotate the screen while the VM is running.

If you've got any way around this, please let me know!

Source

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog