27

I've got a dual-core 1.6Mhz CPU with 2G RAM, thus, I'm trying to use the emulator external to Eclipse and install/un-install the .apk using adb. When I try to build the project (after some code changes) without running it, Eclipse seems to-do nothing ?? any idea how to make Eclipse re-build the .apk without the need to Run it

Thank you

ronenp
  • 381
  • 1
  • 3
  • 5
  • The old ADT will automatical generate the apk file after auto-building. But I don't know since which version, the new ADT won't auto generate the apk. – Johnny Jun 26 '12 at 10:16

4 Answers4

26

On a Mac menubar: Eclipse -> Preferences

On Windows menubar: Windows -> Preferences

From this Preferences window: Android -> Build

Now uncheck "Skip packaging and dexing until export or launch. (Speeds up automatic builds on file save.)"

You may have to restart Eclipse for the preference change to actually be reflected.

ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
  • 1
    This answer works for me. Quite handy if you want the Build command to actually, you know, build everything. – Andrew Cottrell Sep 11 '13 at 20:53
  • Thanks, saved my day, if after turning this option you get the following error 'GC overhead limit exceeded' - please checkout: https://docs.oseems.com/general/application/eclipse/fix-gc-overhead-limit-exceeded or http://stackoverflow.com/questions/23080078/eclipse-crashes-with-a-gc-overhead-limit-exceeded-error – benchuk Sep 25 '14 at 16:06
  • Also for mac users note that the location of the eclipse.ini file: http://wiki.eclipse.org/Eclipse.ini right click show package content and then Eclipse.app/Contents/MacOS – benchuk Sep 25 '14 at 16:12
3

By default, Eclipse auto-builds the .apk as you make changes. You can find this at any time in the your project's bin/ directory.

If there are no new changes (and you haven't performed a clean on the project) then requesting a build will do nothing as Eclipse has nothing to do; it already compiled the project for you.

Geekswordsman
  • 1,297
  • 8
  • 10
  • Hmmm...I have started the emulator from command, then installed the .apk using adb and reviewed my app ("HelloWorld"). Then I've modified one of the strings in the res/values folder (to "Ronen's App"), saved it and uninstalled the .apk and reinstalled it using adb. Yet, the result stayed the same ("HelloWorld") and the string view didn't change ?? (autobuild was on) – ronenp Nov 10 '11 at 19:49
  • This may have been true in early versions of ADT - it's not the current behavior. – James Moore Jul 19 '12 at 17:59
1

Right click on your project in Eclipse. Choose "Android Tools". Choose "Export Unsigned Application Package".

Simon K
  • 549
  • 4
  • 3
-1

I'm not much more experience than you are with Android, but from what I understand, the .apk is built incrementally as you modify the sources. So you don't have to do anything. Just save your code and use the .apk.

Kevin Coulombe
  • 1,517
  • 1
  • 17
  • 35