android - 使用 "adb shell am instrument"时如何检索测试结果

标签 android android-studio adb

我正在使用以下命令在我的 Android 设备上执行一些测试:

adb shell am instrument -w package.name/android.test.runner.AndroidJUnitRunner

我可以通过STDOUT看到测试进度和简单的结果。但是,这个过程是否也会在设备内部生成一个结果文件(xml、html 等)?如果是,它存储在哪里?

谢谢

最佳答案

But, does this process also generates a results file inside the device (xml, html, etc)?

不,它没有。

报告生成通常在比“am instrument”更高的层级处理。如果您使用 Gradle 运行测试,它应该会为您生成报告。我相信这也是 Android Studio 所依赖的。

如果您必须从测试本身生成报告,您可以使用自定义测试运行器。请参阅此答案以了解一种方法:http://www.stackoverflow.com/a/5574418/1999084

关于android - 使用 "adb shell am instrument"时如何检索测试结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33896315/

相关文章:

java/android - TimeZone 的一致方式 3 字母缩写

android - 适用于 Android 的基于应用程序的防火墙

android - 添加库以进行刀柄测试的问题

javascript - Android webview - JavaScript 回调不起作用?

android - 为 Android 项目构建 VLC 在 Ubuntu 12.04 上失败

android - Eclipse 无法检测到 Android 手机

android.content.res.Resurces$NotFoundException : String resource ID #0x0

android-studio - 对等方未通过身份验证 : Error while building app in Android Studio

android - 如何从 adb 在 Android 模拟器上启动和执行 Vending.apk

Android Things - 当我不知道 IP 地址时如何连接到我的树莓派