Tuesday, May 4, 2010

Create an android development ADV (Android Virtual Device) in Linux

1. Download the android SDK.  Install it somewhere like '~/android/'

2. Create virtual device for emulator

 // cd into the root of the sdk you just downloaded after unzipping it
 $> cd android_sdk_directory

 // Runs GUI to install platforms. You need them to set different 
 //  virtual devices for the different android versions.
 $> tools/android

 // A GUI will come up, go to 'Installed Packages' click 'Update All'.
 //  This should start downloading the SDK Platforms you need.

3.  Get the target ID you would like to use for the emulator.
 //  This shows which target id to use to get the emulator
 //  to simulate different android versions. The target ID is the
 //  number by each 'id:'.
 $>tools/android list targets

4. Create your virtual device for the target ID from above
 // For me, id 3 was for android version 1.6. For you, it may be different.
 $> tools/android create avd -n avd_v1.6_id3 -t 3

 // Just for fun, I will create another virtual device for a different version
 $> tools/android create avd -n avd_v2.1_id6 -t 6

 // It asked me to create a custom hardware profile, I said no. if
 //  I need it later, I wall revisit this, for now, probably fine.

5. Fire up the emulator
 $> tools/emulator -avd avd_v1.6_id3
 // or
 $> tools/emulator -avd avd_v2.1_id6

 // The emulator should fire up and you should be able to take
 //  android for a spin...

No comments:

Post a Comment