Cocos2D-X develop for Android on Virtual Box

Android can be installed as a virtual machine, but cocos2d-x needs OpenGL support.
This is where AndroidVM comes in.You can download it at AndroidVM.For this setup I used a linux environment.
Setting it on other platforms would be almost the same.

Required Software:

  • VirtualBox – I guess you already know what this one is since you are here.
  • AndroidVM – An Android virtual machine
  • AndroidVMPlayer – This is the emulator like device we will be using
  • Android SDK – we will use SDK platform-tools(adb) for connecting to the Virtual machine.
  • Android NDK – compile your cocos2dx project


  1. Download and install VirtualBox.
  2. Download AndroidVM (Choose one according to your OS)
  3. Download AndroidVMPlayer and extract it somewhere you can easily find
  4. Import AndroidVM to VirtualBox (double click the downloaded VM or import through menu)
  5. You can close the virtualbox now
  6. In your PC now, open a terminal and cd to the folder you extracted AndroidVMPlayer and execute ./
  7. It will setup the virtual machine and hardware acceleration for you, when the virtual device starts you will see an IP on the window title, this IP will be used to connect the adb with AndroidVM

Connecting the adb

  1. Goto your android-sdk/platform-tools
  2. Execute ./adb connect IP (of the virtual machine, the one you noted ex:
  3. If connected the next time you try launching your Android app from Eclipse you can choose AndroidVM as a device.

Usage and Notes:

  • You can start AndroidVM through so no need to launch virtual box , but still need to connect with adb
  • Using api 2.3 – be sure to add APP_ABI := x86 to your or you will get UnsatisfiedLinkError
  • Using api 4.0 – APP_ABI := armeabi
  • Using api 4.2 – APP_ABI := armeabi-v7a
  • AndroidVMPlayer may need 1-2 seconds to refresh when switched to another window and back (same as the emulator)

Enjoy fast openGL supported virtual device 🙂

Recent Posts