Difference between Clean Project, Rebuild Project and Reformat Code in Android Studio

2

I have this little doubt that there is a difference between these IDE options. What is the difference between them?

    
asked by Eduardo 16.05.2017 в 13:12
source

2 answers

2

Clean Project : as its name implies, it cleans the project, actually initializes it before a new construction. By performing this action you can see that several elements within app\build are removed, including the .apk (android artifact) that is located within the /outputs directory.

Rebuild Project : Perform the same action as Clean Project but followed by the construction of the project. This option rebuilds the content of app\build .

Reformat code : it is an option to apply the correct format to the code, apply spacing, indents, keywords, etc. This reformatting can be applied to the selected text, the entire file, or the entire project.

Windows

  

Ctrl + Alt + L

Mac:

  

Option + Command + L

    
answered by 16.05.2017 / 17:05
source
1
  • A clean deletes all artifacts from the build.
  • A rebuild cleans the entire build of your project, that is, restarts it as I said before.
  • Reformat Code changes code that may be badly formatted, that is, this wrong tab, bad commas.

Of those three I only recommend using the first two, they are usually useful, while the third can use it but in my case it has never solved anything. I hope it has served.

    
answered by 16.05.2017 в 13:16