Tuesday, January 24, 2012

Command line steps to create AVD and install APK on Android emulator

Steps to create AVD and install apk on the emulator via Command line:
1. Open command prompt
2. Navigate to C:\Program Files\Android\android-sdk-windows\tools
3.>   android create avd -n <name> -t <targetID> [-<option> <value>] ... 
Example: android create avd -n haritest -t 5
               id: 5 or "android-9"
               Name: Android 2.3
               Type: Platform
               API level: 9
               Revision: 1
               Skins: HVGA (default), WVGA800, WQVGA432, QVGA, WVGA854, WQVGA400
[For more info: http://developer.android.com/guide/developing/devices/managing-avds-cmdline.html]
4. Now run the newly created emulator
               emulator -avd haritest
5. To check the devices / emultors running
               adb devices
6. To install APK on the emulator
               adb install 
               Example: C:\Program Files\Android\android-sdk-windows\tools>adb install C:\android-sdk-wi
               ndows\tools\AndroidCalculator.apk
7. Location at which avd is created:
C:\Documents and Settings\hdoki\.android\avd>cd .android

---- 


To Uninstall App from emulator UI:
SETTINGS -> APPLICATIONS -> MANAGE APPLICATIONS -> Click On Your App Name -> UNINSTALL


From command prompt: adb uninstall com.android.test

1 comment:

HKD said...

To Uninstall APK Files from Android Device Emulator:

Start the console terminal ("Start -> Run... -> type 'cmd'" for Windows PCs).
Type-in the following command: adb shell rm data/app/ where is the name of the APK file.