简体   繁体   中英

Automatically Rebuild Android Studio Project on Gradle Sync

How do you run a Gradle command everytime the project syncs (though the sync button after changing Gradle files)? Specifically, I would like to run "Rebuild project" or "clean, generateSources".

Go to View->Tool window->Gradle There you can pick the gradle task you want and right click it and choose execute before sync

You can also create a shortcut to that task

At Time of gradle process you can't rebuild project you should wait for completion.

But to rebuild project from android studio follow these steps:

1)Go to Build(alt + B)
2)Click on Rebuild.

If you want to sync gradle then follow below steps:

1)Go to Tools(alt + T)
2)Android ->
3)Now click on Sync Project with Gradle File
(OR from toolbar click on gradle icon which right of AVD Manager)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM