Is there a way to get Eclipse to automatically clear every run?

I am developing for Android and using Eclipse to create apk, which also has a .so file with C ++ code. My problem is that when I just change the code in C ++ and recompile that outside of Eclipse, Eclipse actually does not always see that it has changed, and I have to clean up the project and rebuild it before I can run reliably his. This behavior cost me a lot of time because Eclipse is not using the new .so file.

Is there a way to make Eclipse always rebuild the project before it starts?

+7
source share
3 answers

I'm not sure how familiar you are with ant, but if you are compiling C ++ files through the command line, you need to think about creating an ant build script that will:

  • recompile your c ++ files
  • clean and create your apk
  • install apk on your device.

Then you can be sure that the generated apk is always created using the last compiled code.

+2
source

In the "Project Settings" section, go to "C / C ++ Build.

Select the "Developer Settings" tab.

Uncheck "Use default build command" and in the "Build command" field, simply add the target "clean" as the first target.

eg. if you have

> make -j2 settings 

change it to

 > make clean -j2 settings 
+3
source

As far as I know, there is no way to make eclipse always clean when you press the play button. You may consider another IDE such as IntelliJ. You never have to โ€œcleanโ€ the project, so I assume that they rebuild the project every time you press the play button ...

0
source

All Articles