在Android Studio中运行Robolectric测试时如何进行调试? [英] How to debug when running Robolectric tests in Android Studio?
问题描述
我在Android Studio + Robolectric中测试执行时需要运行调试。
每次我尝试通过从Gradle任务中选择 test
任务的 debug
来运行它,我得到错误消息:
运行package_name时出错:app_name [test]:无法打开调试器
port:java.net.SocketException Socket closed
任何想法?
我发现错误的原因。要使其运行,您需要在编译器 - >Android Studio的Gradle设置中取消选中使用进程内构建选项。
I need to run debug while my tests execution in Android Studio + Robolectric.
Each time I try to run them by selecting debug
for the test
task from Gradle tasks I get the error message:
Error running package_name:app_name [test]: Unable to open debugger port : java.net.SocketException "Socket closed"
Any ideas?
I found the reason of the error. To make it run you need to uncheck the "Use in-process build" option in Compiler -> Gradle settings of Android Studio.
这篇关于在Android Studio中运行Robolectric测试时如何进行调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!