{"id":101,"date":"2014-11-20T19:47:11","date_gmt":"2014-11-20T19:47:11","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=101"},"modified":"2015-07-19T08:35:26","modified_gmt":"2015-07-19T15:35:26","slug":"android-vmware","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/android\/vmware\/","title":{"rendered":"Using VMWare to replace the slow Android Emulator"},"content":{"rendered":"<p>This tutorial shows how to accelerate the Android App development using virtual devices by replacing the slow Android emulator with faster VMWare. Most of the techniques described here will also work with other virtualization software like VirtualBox.<\/p>\n<p>We will first setup a virtual machine, then install Android there and finally use Visual Studio to debug the San-Angeles sample on it. Using VMWare has an advantage of much faster simulation speed, however it will only simulate the x86 Android system, hence if you want to debug an ARM-specific problem, you will still need an actual device or the slow ARM emulator.<\/p>\n<p>Before you begin, install <a href=\"\/download\/\">VisualGDB<\/a> and download an x86 Android image from <a href=\"http:\/\/www.android-x86.org\/download\">android-x86.org<\/a>, a project providing Android images compatible with moder PCs.<\/p>\n<ol>\n<li>Open VMWare and begin creating a new typical VM:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/01-typicalvm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/01-typicalvm.png\" alt=\"01-typicalvm\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Select &#8220;I will install the operating system later&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/02-oslater.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/02-oslater.png\" alt=\"02-oslater\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Select &#8220;Linux&#8221; as the operating system:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/03-linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/03-linux.png\" alt=\"03-linux\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Specify the VM name and the folder where you want to keep it:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/04-vmpath.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/04-vmpath.png\" alt=\"04-vmpath\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Proceed with the default parameters for the disk. Note that VMWare will create a SCSI disk by default and we will have to replace it with an IDE one:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/05-disk.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/05-disk.png\" alt=\"05-disk\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Before completing the wizard click &#8220;Customize hardware&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/06-customize.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/06-customize.png\" alt=\"06-customize\" width=\"432\" height=\"391\" \/><\/a><\/li>\n<li>Then we need to do 3 customizations. First, switch the network to the bridged mode so that the emulated device gets an IP address we can connect to:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/07-bridged.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/07-bridged.png\" alt=\"07-bridged\" width=\"659\" height=\"559\" \/><\/a><\/li>\n<li>Then mount the ISO image you downloaded to the virtual CD drive:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/08-iso.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/08-iso.png\" alt=\"08-iso\" width=\"697\" height=\"577\" \/><\/a><\/li>\n<li>Finally, remove the hard disk and add an IDE one instead of it:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/09-idehdd.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/09-idehdd.png\" alt=\"09-idehdd\" width=\"432\" height=\"375\" \/><\/a><\/li>\n<li>Now you can start the virtual machine. The ISO image you have specified will show a prompt asking whether you want to run Android or install it. Select &#8220;Installation&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/10-install.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/10-install.png\" alt=\"10-install\" width=\"640\" height=\"480\" \/><\/a><\/li>\n<li>A basic text-mode Linux environment will boot and the installation menu will appear. Select &#8220;Create\/Modify partitions&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/11-partition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-11\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/11-partition.png\" alt=\"11-partition\" width=\"700\" height=\"393\" \/><\/a><\/li>\n<li>Create one Linux partition for the entire disk and select &#8220;Save&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/12-writepart.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/12-writepart.png\" alt=\"12-writepart\" width=\"700\" height=\"421\" \/><\/a><\/li>\n<li>Once you exit the cfdisk tool, the created partition will appear in the menu. Select it to continue:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/13-part.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/13-part.png\" alt=\"13-part\" width=\"700\" height=\"388\" \/><\/a><\/li>\n<li>Format the partition with the ext3 file system:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/14-format.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/14-format.png\" alt=\"14-format\" width=\"700\" height=\"392\" \/><\/a><\/li>\n<li>In order to boot Android from the hard disk, install the GRUB loader:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/15-bootldr.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/15-bootldr.png\" alt=\"15-bootldr\" width=\"700\" height=\"390\" \/><\/a><\/li>\n<li>The installer will ask you whether you want the system directory to be read-write. Select &#8220;Yes&#8221; as we will need to do some modifications to support debugging properly:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/16-systemrw.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/16-systemrw.png\" alt=\"16-systemrw\" width=\"700\" height=\"391\" \/><\/a><\/li>\n<li>The Android installer will then install the system to your hard disk. When it completes, select &#8220;Reboot&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/17-reboot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/17-reboot.png\" alt=\"17-reboot\" width=\"700\" height=\"391\" \/><\/a><\/li>\n<li>After you restart the VM, it will boot from the hard disk allowing to select the mode to start. Select the default one:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/18-boot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-18\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/18-boot.png\" alt=\"18-boot\" width=\"637\" height=\"477\" \/><\/a><\/li>\n<li>Once Android loads, it will show the customization menu. Select your language from the list and click on the button to the right:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/19-welcome.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/19-welcome.png\" alt=\"19-welcome\" width=\"700\" height=\"457\" \/><\/a><\/li>\n<li>Skip the WiFi setup. As VMWare is emulating a wired controller, we won&#8217;t need WiFi:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/20-skipwifi.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-20\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/20-skipwifi.png\" alt=\"20-skipwifi\" width=\"700\" height=\"497\" \/><\/a><\/li>\n<li>Once done with personalization, select Terminal from the list of apps:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/21-terminal.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/21-terminal.png\" alt=\"21-terminal\" width=\"700\" height=\"527\" \/><\/a><\/li>\n<li>Now we need to find out the IP address of the Android VM and adjust file permissions on the run-as tool to support debugging properly. Run the following commands in the terminal:\n<div>ifconfig eth0<br \/>\nsu<br \/>\nchmod 4750 \/system\/bin\/run-as<\/div>\n<p><a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/22-sudo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/22-sudo.png\" alt=\"22-sudo\" width=\"700\" height=\"529\" \/><\/a><\/li>\n<li>On your Windows machine open command prompt in the &lt;Android SDK&gt;\\platform-tools folder and run the following command:\n<div>adb connect &lt;IP address of the VM&gt;:5555<br \/>\nadb shell<\/div>\n<p><a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/23-adbshell.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/23-adbshell.png\" alt=\"23-adbshell\" width=\"677\" height=\"342\" \/><\/a>Verify that the shell opens successfully.<\/li>\n<li>Open Visual Studio and start creating a VisualGDB Android project. Select &#8220;Clone a sample from NDK&#8221; on the first page:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/24-androidprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-24\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/24-androidprj.png\" alt=\"24-androidprj\" width=\"649\" height=\"616\" \/><\/a><\/li>\n<li>On the next page select the san-angeles sample:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/25-sanangeles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/25-sanangeles.png\" alt=\"25-sanangeles\" width=\"649\" height=\"616\" \/><\/a><\/li>\n<li>On the last page select a platform version and ensure that x86 is selected in the hardware platform list:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/26-x86.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/26-x86.png\" alt=\"26-x86\" width=\"649\" height=\"648\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to complete creating your project. Once it is created, remove the Linux and Win32 files from Solution Explorer:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/27-removefiles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-27\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/27-removefiles.png\" alt=\"27-removefiles\" width=\"699\" height=\"606\" \/><\/a><\/li>\n<li>Press F5 to build your project and begin debugging it. The app will start inside the VM:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/28-sanangeles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/28-sanangeles.png\" alt=\"28-sanangeles\" width=\"700\" height=\"526\" \/><\/a><\/li>\n<li>Set a breakpoint somewhere in the code (e.g. in prepareFrame()) to verify that debugging is working:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/29-breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-29\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/android\/vmware\/29-breakpoint.png\" alt=\"29-breakpoint\" width=\"697\" height=\"604\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to accelerate the Android App development using virtual devices by replacing the slow Android emulator with<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[31,47],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/101"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":187,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/101\/revisions\/187"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}