0

I'm writing an automation script to check my new photo gallery application. I've been trying to get am to show images using the ACTION_VIEW intent but for some reason it doesn't work. Here's what I've tried:

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

or

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

however, both commands fail with the following error:

Starting: Intent { act=android.intent.action.VIEW dat=/sdcard/Android/test.jpg } Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=/sdcard/Android/test.jpg flg=0x10000000 }

Any ideas?

Thanks.

and-auto
  • 3
  • 2

1 Answers1

1

You need a MIME type on that Intent via the -t switch. See this SO question and answer for more details.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491