How to delete/uninstall an Android app from an emulator from the command line

I recently had a problem with an Android emulator, and for some reason I wasn't able to delete the Android app I was developing. I knew you could delete Android apps from the command line, but I had no need to do this until now.

After reading a few docs, I found that I could delete my Android app from the command line using the adb command, like this:

$ adb uninstall com.devdaily.fptracker

I think the only important things are:

  • The string com.devdaily.fptracker is the root package name for my application. (My main Activity is "com.devdaily.fptracker.MainActivity.)
  • The emulator has to be running when you run this command.
  • I've also read that you should only have one emulator running when you issue this command. I don't normally run multiple emulators, so I haven't tried this (though the problem with doing this seems obvious).

adb uninstall - "waiting for device" message

After you issue this command, you should get a "Success" message back fairly soon. When things were really hosed up I saw this message after issuing the adb uninstall command:

- waiting for device -

Whenever I got this message, I never got a "Success" message after it, or more accurately, I never waited more than a few minutes before shutting everything down and restarting the emulator (and possibly Eclipse ... I don't remember).