当我单击“运行"时,Android Studio正在运行哪些Gradle命令? [英] What Gradle commands are Android Studio running when I click Run?

查看:323
本文介绍了当我单击“运行"时,Android Studio正在运行哪些Gradle命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Android Studio中单击运行"时,我想知道正在执行哪些特定的Gradle命令行.通过Gradle控制台,它可以显示执行结果,但不显示命令行任务和参数.当单元测试在特定的程序包,方法或类上运行时,我对Gradle命令行参数有什么特别感兴趣.

When I click 'Run' in Android Studio, I want to know what specific Gradle command-line is being executed. Through the Gradle Console it shows you the results of what's being executed, but not the command-line task and arguments. I'm specifically interested in what the Gradle command-line arguments are when unit tests are ran on a specific package, method, or class.

推荐答案

我还没有找到一种方法来查看Android Studio中实际执行的gradle命令,但是,如果您只对运行特定的单元测试感兴趣,请在

I haven't found a way to see the actual executed gradle command in Android Studio, however if you're only interested in running specific unit tests here's how.

要运行包中的所有单元测试,请执行以下操作:

To run all unit tests within a package:

./gradlew testAppDebug --tests="*.my.package.name.*"

或一个班级

./gradlew testAppDebug --tests="*.my.package.name.MyClassTest"

或单个测试方法(在我们的示例中为simpleTest):

Or a single test method (in our case named simpleTest):

./gradlew testAppDebug --tests="*.my.package.name.MyClassTest.simpleTest"

希望它会有所帮助:)

这篇关于当我单击“运行"时,Android Studio正在运行哪些Gradle命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆