Make Android Studio work with AndroVM (VirtualBox)

After playing around for a little while with Android on a real device, I thought I’d post on how I got my AndroidVM to work with the new Android Studio.

  1. In VirtualBox Settings for the Device, enable Port Forwarding, using 5555 as the Host Port and 5555 as the Guest Port.
    Virtual Box Port Forwarding Setup
  2. Open a Console/Command Prompt and go to your Android Studio installation and run adb connect
    running ADB to connect to Virtual Box
  3. Now setup your project in Android Studio and Run It when it Pops the user interface, select the Emulator Null.
    Select the Device to Connect To
  4. You should now see in the output the following information
    Waiting for device.
    Target device: emulator-5554
    Uploading file
    local path: C:\Users\paul\AndroidStudioProjects\VMConnectProject\VMConnect\build\apk\VMConnect-debug-unaligned.apk
    remote path: /data/local/tmp/com.example.vmconnect
    Installing com.example.vmconnect
    DEVICE SHELL COMMAND: pm install -r “/data/local/tmp/com.example.vmconnect”
    pkg: /data/local/tmp/com.example.vmconnect

    Launching application: com.example.vmconnect/com.example.vmconnect.MainActivity.
    DEVICE SHELL COMMAND: am start -n “com.example.vmconnect/com.example.vmconnect.MainActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
    Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.vmconnect/.MainActivity }

    Android Studio Connection Output
  5. You should now be able to debug and Test your application in the Andoid VM on VirtualBox.