My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://kavachai.com
and update your bookmarks.

Thursday, July 30, 2009

Installing & uninstalling applications on emulator

Story 1. Installing application.
To install application to emulator adb utility will be handy:
  • Start emulator.
  • Open command prompt (cmd.exe).
  • Navigate to "tools" directory in Android SDK.
  • Run installation using command "adb install application.apk". For example, "adb install "C:/com.andreware.sample.apk"" when com.andreware.sample.apk is located at root directory on disk C.
  • Wait couple of seconds while application is being installing.

Story 2. Uninstalling application.
There two ways to uninstall application from emulator: uninstall like on real device or use adb utility. First way allows to uninstall any application while adb utility will allow to uninstall only application installed using it (including the ones deployed from IDE).
Let's look at first one first. It is pretty simple and straitforward:
  • Start emulator.
  • On the home screen press the "Menu" button.
  • Choose"Settings" item from menu.
  • Choose "Applications" item in the settings list.
  • Choose "Manage applications".
  • Choose application that you want to uninstall.
  • In the "Application info" window that will appear click "Uninstall" button.
  • Confirm uninstalling.
  • Wait a second while application is being uninstalling and click "OK" on next window that says "Uninstall finished".
Second way requires usage of command line and adb utility:
  • Start enulator.
  • Open command window (cmd.exe).
  • Navigate to "tools" directory in Android SDK.
  • Run remote shell: "adb shell".
  • Goto app directory: "cd /data/app".
  • Now you can list installed applications: "ls".
  • To uninstall application use "rm" command and appropriate apk file. For example, "rm com.andreware.sample.apk".
  • Type "exit" to leave remote shell.

No comments:

Post a Comment