Wednesday, May 30, 2012

[How to] Install Android 4.0 under VMware

1) Download image from http://www.buildroid.org/Download/android-x86-vm-20120307.iso.gz and decompress it

2) Use VMWare to mount the iso and create a virtual machine
Type : FreeBSD
Harddisk : 10G
Ram : 512MB

3) Choose Install Android-x86 to harddisk


4) Create partition and format the primary partition and then create a fake SD Card for 2G


5) After Android OS started. Run the Terminal Emulator inside the Android to get the IP Address. Type "netcfg" inside the Terminal
say the ipaddress is 172.16.85.133

6) To push file or app to the Android OS under VMWare, you need to install Android SDK. (say installed in ~/android-sdk-macosx/)

7) For example, to push Music to the sdcard
~/android-sdk-macosx/platform-tools/adb connect 172.16.85.133
~/android-sdk-macosx/platform-tools/adb push ~/Mymusic.mp3 /sdcard/Music/


8) To compile and install a sample app to the Android OS
~/android-sdk-macosx/platform-tools/adb connect 172.16.85.133
cd ~/android-sdk-macosx/samples/ActionBarCompat/
~/android-sdk-macosx/tools/android update project -t 1 -p .
ant debug
~/android-sdk-macosx/platform-tools/adb install bin/MainActivity-debug.apk

# -r option is to reinstall
~/android-sdk-macosx/platform-tools/adb install -r bin/MainActivity-debug.apk


9) Shell access
~/android-sdk-macosx/platform-tools/adb connect 172.16.85.133
~/android-sdk-macosx/platform-tools/adb shell


No comments: