简体   繁体   English

clean 和 gradlew clean 的区别

[英]Difference between clean, gradlew clean

What is the difference between the following statements when issued from a Android Studio Project's terminal :从 Android Studio 项目的终端发出以下语句有什么区别:

Android_Studio_Project_Path: ./gradlew clean Android_Studio_Project_Path: ./gradlew clean

Android_Studio_Project_Path: ./gradlew clean assembleDebug Android_Studio_Project_Path: ./gradlew clean assembleDebug

Android_Studio_Project_Path: ./gradlew clean :assembleDebug Android_Studio_Project_Path: ./gradlew clean :assembleDebug

and normal Android Studio --> Build --> Clean.和普通的 Android Studio --> Build --> Clean。

What would be the difference in the internal process.内部流程会有什么不同。

  1. ./gradlew clean

    Uses your project's gradle wrapper to execute your project's clean task.使用项目的gradle 包装器来执行项目的clean任务。 Usually, this just means the deletion of the build directory.通常,这只是意味着删除构建目录。

  2. ./gradlew clean assembleDebug

    Again, uses your project's gradle wrapper to execute the clean and assembleDebug tasks, respectively.同样,使用项目的 gradle 包装器分别执行cleanassembleDebug任务。 So, it will clean first, then execute assembleDebug , after any non-up-to-date dependent tasks.因此,它将首先清理,然后在任何非最新相关任务之后执行assembleDebug

  3. ./gradlew clean :assembleDebug

    Is essentially the same as #2.与#2 基本相同。 The colon represents the task path.冒号代表任务路径。 Task paths are essential in gradle multi-project's , not so much in this context.任务路径在gradle multi-project's中是必不可少的,在这种情况下并不是那么重要。 It means run the root project's assembleDebug task.这意味着运行根项目的 assembleDebug 任务。 Here, the root project is the only project.在这里,根项目是唯一的项目。

  4. Android Studio --> Build --> Clean

    Is essentially the same as ./gradlew clean .本质上与./gradlew clean相同。 See here .这里

For more info, I suggest taking the time to read through the Android docs, especially this one .有关更多信息,我建议花时间阅读 Android 文档,尤其是这个

You should use this one too:你也应该使用这个:

./gradlew :app:dependencies (Mac and Linux) - With ./ ./gradlew :app:dependencies (Mac 和 Linux) -使用./

gradlew :app:dependencies (Windows) - Without ./ gradlew :app:dependencies (Windows) -没有./

The libs you are using internally using any other versions of google play service.If yes then remove or update those libs.您在内部使用任何其他版本的 google play 服务的库。如果是,则删除或更新这些库。

You can also use你也可以使用

./gradlew clean build (Mac and Linux) -With ./ ./gradlew clean build (Mac 和 Linux) - 带有 ./

gradlew clean build (Windows) -Without ./ gradlew clean build (Windows) - 没有 ./

it removes build folder, as well configure your modules and then build your project.它删除构建文件夹,以及配置您的模块,然后构建您的项目。

i use it before release any new app on playstore.我在 Playstore 上发布任何新应用程序之前使用它。

兄弟,这个问题确实得到了 69 票。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 gradlew clean vs gradlew clear有什么区别 - gradlew clean vs gradlew clear what is the difference React Native,无法清理gradlew - React Native, unable to clean gradlew ./gradlew clean 实际上做了什么? - What does ./gradlew clean actually do? gradlew assemble和gradlew compile有什么区别 - What is the difference between gradlew assemble and gradlew compile gradlew build和gradlew assemble有什么区别 - What is the difference between gradlew build and gradlew assembleRelease Android 中具有干净架构的 mvvm 和没有干净架构的 mvvm 有什么区别? - What is difference between mvvm with clean architecture and mvvm without clean architecture in Android? Android Studio中清理项目和重建项目之间的区别 - Difference between clean project and rebuild project in android studio Android的clean project和delete build目录有什么区别? - What is the difference between clean project and delete build directory of Android? 尝试添加库,但使用Gradlew Clean:在Android Studio中构建失败 - Tried to Add Library, but with Gradlew Clean: Build Fails in Android Studio Android Studio 2.3.3中的“清理”和“重建”没有什么区别,那么为什么“构建”菜单中有两个选项? - There is no difference in Android Studio 2.3.3 between Clean and Rebuild, so why have both options in Build menu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM