Debugging using a virtual machine like VMWare/VirtualBox? Debugging using a virtual machine like VMWare/VirtualBox? android android

Debugging using a virtual machine like VMWare/VirtualBox?


Solution:

I would highly recommend to use Android x86 coz it many many times faster than Android emulator with Android x86 4.2 you can install and use any application with this and use "Google play" synch with your account as you do it with tablet

Working with latest Android X86 4.2 Jelly Bean and Virtual Box

I have found Different ways to connect with Internet and adb

Step: 1 Selection of Adapters

CASE 1: Only Internet {NAT Adapter}

The easiest solution is just use NAT adapter that will directly connect you to internet if host is connected to internet but you won't get the adb connection with this setupHere you will get Public ip so you can't connect to Host computer

NAT adapter

Case 2: Only adb {Host Only Adapter}

The easiest solution is just use Host Only Adapter

Host Only Adapter Settings

Note: The default Host Only adapter may not work due to DHCP server settings either create new HostOnlyAdapter or run DHCP server for existing Adapter()

Case 3: For both adb and Internet {Bridge Adapter}

You will have to take care in this case.

If you are using LAN for internet connection you shall use Bridge Adapter with your Ethernet card it will give you local ip and Virtual Machine will connect to Internet using host machine

Alternatively if you are with Wifi just do the same by selecting the Wifi adapter

For other type of connection you shall go with the same way

Bridge Adapter

Step: 2 Connection with adb

to check the ip Address just press Alt+F1 {for console Window} [To switch back to Graphics view press Alt+F7 ]

you will see the console window type netcfg

it will show the ip address

Now move on to you host run command prompt move to adb directory type

 adb connect {your ip address}

Example

adb connect 192.168.1.51

Note: if adb is not running or responding you can do following

adb kill-serveradb start-server 

you can check devices connected to adb

adb devices


As per your edited question, if you want to connect it to ADB you need to check what the IP of the VM is: Assuming you use VMWare's player;

Hit ALT-F1 in the VM and use the ifconfig command to know the IP address given to your network device (usually eth0). You can then hit ALT-F7 to go back to the Android UI.

Then, in your host PC, execute the adb connect [ANDROID_X86_IP] to connect the SDK debugger to your Android x86 VM; for example: adb connect 192.168.1.100:5555.

You should then see the list of devices connected and then it will be enabled to use for debugging.

ADB is typically located on your computer in a subfolder to your user folder in: ~/Android/Sdk/platform-tools. It is recommended to add it to your path so you can access it using the terminal wherever. I personally use this in ~/.bash_profile:

#add Android platform-tools directoryPATH=~/android-sdks/platform-tools:$PATHexport PATH

In case ADB fails the first time, you can try adb kill-server ; adb start-server to reset ADB.

If you want to read further, check out the Android-x86 website. It also has a lot of disc images available for download.


This is not a direct answer to your question, but did you see tricks to increase performance of emulator (read Why is the Android emulator so slow? How can we speed up the Android emulator?)

a) Use Intel Atom x86 instead of ARM

b) Use hw.gpu.enabled

I would say this makes emulator quite comparable in performance to a real device.

Update 1

Generally speaking, the idea is to configure Android PC to use tcp/ip for adb connection. And you may need to play around with network settings on VMWare or VirtualBox.

Useful links (which try to accomplish what you want

No network connection - Android-x86 on VMWare Fusionhttp://lkubaski.wordpress.com/2012/08/15/running-android-on-vmware-player-with-networking-enabled/http://www.transdroid.org/2011/01/26/techpost-debugging-against-a-virtual-machine-android/