Running Android 4.0 (ICS) on Virtualbox

Debugging things on the Android Emulator (incluced in the SDK) can be a very slow and cumbersome process. Thanks to the Android-x86 Project it’s quite easy to run Android in VirtualBox. This is highly useful when you need to test mobile apps and websites from the Android Browser (as well as Chrome Mobile).

  1. Download an Ethernet enabled ISO from Tablets x86

    wget http://dl.dropbox.com/u/75945873/android-x86-4.0-eth0-generic_x86-20120426.iso.torrent
    transmission android-x86-4.0-eth0-generic_x86-20120426.iso.torrent

  2. Create new ViratualBox VM
    VM Settings 1
    VM Settings 2
    VM Settings 3
    Important Settings (see screenshots)

    • OS: Linux, Version: Linux 2.6
    • Enable VTx/AMD-V
    • Use Bridged Network Adapter (if you want to allow direct Internet Access)
  3. Mount the ISO file downloaded previosly and start the VM
    Install dialog
  4. Create the Root Filesystem (ext3) on the VBox .vdi created with the new VM, mark as bootable
  5. Write the Filesystem changes to disk (VDI) and format the disk
  6. Install GRUB Boatloader
  7. Copy files from ISO to VDI
  8. Unmount the ISO image and reboot
  9. Note: You need to disable the mouse pointer integration (if you have installed VirtualBox Client Add-ons) in the menu of Virtualbox (‘Machine’ –> ‘Disable Mouse Integration’) when you start the VM (see screenshot). I have not found a way to disable this by default on Virtualbox on Ubuntu (If anybody has managed this I would love to know how !)

    Disable Mouse Integration

  10. Start the Android Setup Wizard to set locale and you should be up and running (network should already function to test external sites from Android browser) !

Mobile Browser Testing on the Desktop

If you need to check websites for mobile compliance on a regular basis you know that having a device to constantly check is painful and slows down your work during debugging and phases of constant change.

Surrounding myself with screens by adactio, on Flickr
Creative Commons Attribution 2.0 Generic License  by  adactio 

There are a few tools that will make this work a lot easier:

Google Chrome

Chrome does have some nice dedicated plug-ins to help with this task

Firefox

I am not aware of any plug-ins like Chrome, but as a hack I have found it useful to employ a user-agent switching plugin to trick the browser

User Agent Switcher (http://chrispederick.com/work/user-agent-switcher/) works well for this.

  1. Download the User Agent Switcher Add-on for Firefox
  2. Restart Firefox for the add-on change to take place.
  3. To start a new browsing session using an emulated browser, go to Tools > User Agent Switcher and select the appropriate mobile web browser you want to emulate
  4. To switch back to normal browsing, just select the default option from the above menu.

If you need more specific UA Strings check here: http://www.zytrax.com/tech/web/mobile_ids.html

For more serious work there are obviously dedicated emulators from the major Mobile OS vendors (but they need to be installed and configured for each platform):

 

PS: Nothing substitutes final QA testing on actual devices …