Debug a Bluetooth App with Android Emulator on PC

  1. Install VirtualBox. I have version 4.2.10.
  2. Follow these instructions to create a new VM and install android-x86 on it.

Bluetooth Configuration

  1. If you use a Bluetooth USB adapter, follow these instructions to access it from the guest OS (I stopped at “Verification Under the Guest OS”). 
  2. If you use a laptop’s built in Bluetooth device, this should do the trick.
  3. Enable Bluetooth on the guest OS, make sure you can see and pair with whatever device you want.

Network and Remote Debug Configuration

  1. Follow these instructions to enable internet connection on your VM.
  2. Find the IP of your VM by goint to the terminal (Alt+F1 and Alt+F7 to toggle) and running netcfg.
  3. On the host machine, navigate to your android installation folder > platform-tools and execute “adb connect IP” where IP is the IP of your VM.

Now you can see your device in the devices view in eclipse and play with it to your heart’s content.

Other nuisances

  1. If the cursor is not responding when you start your machine, go to Machine ->Disable Mouse Integration. You will have to click on the VM screen to interact with it and press “host” key to escape.
  2. Seems like the current version of Android-x86 has a bug that prevents it from “waking up” when it is locked. You probably want to disable screen locking so that you don’t have to restart the machine after every time you go to the loo.
  3. You can configure the “adb connect” command as an external tool in eclipse so that you can run it inside your IDE:
    1. Click the little arrow near the external tools button, and choose “External Tools Configurations…”
    2. Click “new”
    3. Name your configuration (i.e: “Remote connect adb”)
    4. Location: path to your adb.exe
    5. Working Directory: platform-tools folder in android installation folder
    6. Arguments: connect IP
      Alternatively, you can use ${string_prompt} instead of IP if you want eclipse to ask you which IP you cant to connect to each time you run the command.
    7. Click “Apply”

And that’s it.

6 thoughts on “Debug a Bluetooth App with Android Emulator on PC”

  1. About the link to the instructions for creating the VM Android X86:
    I’m having difficulties with the creation of the virtual sd card. The problem is that when press not appear “DATA=”,and “SDCARD=” which appears in place is “SRC=” and “DATA=”. Have you any idea why this happens? And how to solve this?
    I think here is not the most appropriate place to post this doubt, but I’m a little desperate.
    Thanks in advance.

  2. No habia regresado tu sitio web por un tiempo, porque me pareció que era pesado, pero los últimos posts son de buena calidad, así que supongo que voy a añadirte a mi lista de blogs cotidiana. Te lo mereces amigo. :)

    Saludos

  3. Coming from my research, shopping for technology online may be easily expensive, however there are some tricks and tips that you can use to obtain the best bargains. There are continually ways to locate discount discounts that could help make one to come across the best electronic devices products at the cheapest prices. Interesting blog post. A few things i have always told people is that when searching for a good on the net electronics shop, there are a few aspects that you have to consider. First and foremost, you should make sure to locate a reputable and also reliable retail store that has enjoyed great opinions and scores from other buyers and business world leaders. This will ensure you are getting through with a well-known store that provides good services and aid to the patrons. Thanks for sharing your ideas on this website.

  4. Ꮋi … I’m Jerome. I spend too much timje mining tһe web.
    Here’s an article, from GrubStreet.ca, І thought you might like.
    J

Leave a comment