Take the 2-minute tour ×

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"


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?


share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
I've added -t image/jpeg and it works like a charm! –  and-auto Dec 18 '10 at 15:46

Your Answer


