How do you compile an Android project into an .apk file in Eclipse without launching the emulator?

44,597

Solution 1

I had a problem that it would not build an APK for me (without Running) after I installed the latest SDK and latest Eclipse (Indigo 371).

Try this:

Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch" then restart Eclipse.

Now when you do Build Project you should get an APK

Solution 2

Do you use Eclipse with Android ADT plugin? If so, you can use Android Tools/Export Signed Application Package to build the app as apk file

Solution 3

right click ur project -> select android tools -> and then select export unsigned application and save to a location. Done, ur apk is available

Solution 4

Not sure if I understand your question right, but you can create an .apk file without running by right clicking your project, and then selecting Export. The Android Application option should be available to you.

Solution 5

I had a similar problem but it didn't rebuild the apk file automatically or manually without running the emulator..

You have to make sure that there are no errors (warnings are okay) on any of your projects in the workspace!! after that, check the Build Automatically option in Project tab in Eclipse! from now on, Eclipse will automatically compile your project to apk all the tim

Share:
44,597
trusktr
Author by

trusktr

Joe Pea trusktr.io (personal site) lume.io (open source 3D toolkit I'm working on) twitter github codepen

Updated on July 05, 2022

Comments

  • trusktr
    trusktr almost 2 years

    I'm just wondering because I have my own seperate method of getting it on my phone via my web server and the emulator is getting annoying popping up every time.

  • trusktr
    trusktr over 12 years
    So what if Project > Build Automatically is on? Does that mean it gets built everytime I save?
  • trusktr
    trusktr over 12 years
    Indeed I'm using the Eclipse + ADT plugin, but I don't see what you're talking about. Where's that option located?
  • trusktr
    trusktr over 12 years
    Also, one last question. so doing project > Build Project will not automatically start the emulator, right? (sorry, haven't gotten back into Eclipse to test this yet)
  • trusktr
    trusktr over 12 years
    Cool. I'll try this as soon as I get back on Eclipse!
  • trusktr
    trusktr over 12 years
    I haven't gotten the chance to check this out, but I will as soon as I start my next android project.
  • user999717
    user999717 over 12 years
    It does exactly what it says.
  • Ohad Kravchick
    Ohad Kravchick over 12 years
    This is quite an exhausting process for something that Eclipse does automatically when you Run the project. Isn't there a simpler way?
  • trusktr
    trusktr almost 11 years
    That works, but pressing the compile button still automatically starts the emulator, so this doesn't really address that problem.
  • trusktr
    trusktr almost 11 years
    This might be the answer. Let me try it when I get a chance.