使用活动管理器查看图像

时间:2010-12-18 15:09:08

标签: android automation

我正在编写一个自动脚本来检查我的新照片库应用程序。我一直试图让我使用ACTION_VIEW意图显示图像但由于某种原因它不起作用。这是我尝试过的:

adb shell am start -a android.intent.action.VIEW -d "file:///sdcard/Android/test.jpg"

adb shell am start "file:///sdcard/Android/test.jpg"

但是,这两个命令都失败并出现以下错误:

  

开始:意图{act = android.intent.action.VIEW dat = / sdcard / Android / test.jpg}   错误:活动未启动,无法解析Intent {act = android.intent.action.VIEW dat = / sdcard / Android / test.jpg flg = 0x10000000}

有什么想法吗?

感谢。

1 个答案:

答案 0 :(得分:1)

您需要通过 - Intent开关在t上添加MIME类型。有关详细信息,请参阅此SO question并回答。