Russell Stewart
Russell Stewart

Reputation: 1960

Android, ant, and Eclipse: it never reinstalls the APK on the emulator after rebuilding. How can I fix this?

I have been developing on Android with Eclipse for a while, and I recently switched over to using Ant for my build system. This gives me a number of useful advantages, but it seems to really badly break Eclipse's behavior with respect to building and the emulator.

My biggest problem right now is that, if I change something in my code and hit the "Run" or "Debug" buttons, it rebuilds the app like it's supposed to, but when it comes time to install the app and run it, I get the dreaded "Application already deployed. No need to reinstall." message, and it refuses to install it. Even if I do a "clean" and rebuild my app from scratch, it still doesn't recognize it as newer than the one installed on the emulator.

Of course, I can uninstall the app from my emulator first, but that's a huge PITA, because my app involves setting up a user account after initial install, and I don't want to have to do that every time I am testing a change. I can also force install from the command line through "adb -e install -r ...". That's what I'm doing now, but it's an extra step that shouldn't be necessary. I would really like to be able to take advantage of the "I" part of my IDE and actually compile, run, and install from it the way I am supposed to be able to.

How does the Android SDK in Eclipse decide whether the app needs to be reinstalled? Is there a timestamp on some particular file that it looks at? Is there a way I can force it to install every time?

There has to be a solution to this problem.

Upvotes: 1

Views: 622

Answers (1)

inazaruk
inazaruk

Reputation: 74780

This works fine in my eclipse, and it always had. So I would suggest:

  1. reinstall ADT plugin
  2. reinstall eclipse altogether.

Or you can workaround this issue by adding extra step to your project with "adb -e install -r ..." command line (using ant build script).

Upvotes: 1

Related Questions