Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Robolectric 进行测试时,如何显示应用程序代码中的 Log.d() 输出?目前我使用的是 2.4 版。
我最近经常在我的测试代码中做下一个(因为缺乏与 Android Studio 的集成):
System.out.println("TEST");
并运行gradle:
gradle
gradle testDebug -i
将此作为 VM 参数添加到您的运行配置中(在 Android Studio 中):
-Drobolectric.logging=stdout