title: How to use adb shell to display a local image
body: <p>I want to use <code>adb shell</code> to tell my device to display an image on its SD card.  I thought this command would work:</p>
  
  <pre><code>adb shell am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity -d file:///storage/sdcard0/Android/data/&lt;mypackage&gt;/files/myfile.jpg
  </code></pre>
  
  <p>Unfortunately I get this error:</p>
  
  <blockquote>
    <p>Starting: Intent { act=android.intent.action.MAIN
    cmp=com.android.browser/.BrowserActivity }<br>
    Error type 3<br>
    Error: Activity class
    {com.android.browser/com.android.browser.BrowserActivity} does not
    exist.</p>
  </blockquote>
  
  <p>I also tried doing a <code>VIEW</code> action, and trying with only the <code>-n</code> or the <code>-d</code> parameters.</p>
  
  <pre><code>adb shell am start -a android.intent.action.VIEW -d file:///storage/sdcard0/Android/data/&lt;mypackage&gt;/files/myfile.jpg
  </code></pre>
  
  <p>Using only the <code>-d</code> parameter results in this error (I tried both with and without the "file://" prefix on the path):</p>
  
  <blockquote>
    <p>Starting: Intent { act=android.intent.action.VIEW
    dat=/storage/sdcard0/Android/data//files/myfile.jpg
    }<br>
    Error: Activity not started, unable to resolve Intent {
    act=android.intent.action.VIEW
    dat=/storage/sdcard0/Android/data//files/myfile.jpg
    flg=0x10000000 }</p>
  </blockquote>
  
  <p>The permissions on the file are:</p>
  
  <pre><code>-rw-rw-r-- root     sdcard_rw   198106 2013-01-02 21:29 gUD9w5.jpg
  </code></pre>
  
  <p>I'm testing with a rooted Galaxy Nexus running 4.1.1.  </p>
  
  <p><strong>Update</strong>: I tried dtmilano's suggestion but the Crop tool gives a "Couldn't load the image" popup.  The stack trace from logcat is:</p>
  
  <pre><code>ActivityManager: START {dat=file:///storage/sdcard0/Android/data/&lt;mypackage&gt;/Pictures/myfile.jpg typ=image/* 
      flg=0x13000000 cmp=com.google.android.gallery3d/com.android.gallery3d.app.CropImage u=0} from pid 301
  UriImage: fail to open: file:///storage/sdcard0/Android/data/&lt;mypackage&gt;/Pictures/myfile.jpg
  UriImage: java.io.FileNotFoundException: /storage/sdcard0/Android/data/&lt;mypackage&gt;/Pictures/myfile.jpg: 
      open failed: ENOENT (No such file or directory)
  UriImage:   at libcore.io.IoBridge.open(IoBridge.java:416)
  UriImage:   at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:78)
  UriImage:   at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:105)
  UriImage:   at android.content.ContentResolver.openInputStream(ContentResolver.java:445)
  UriImage:   at com.android.gallery3d.data.UriImage.openOrDownloadInner(UriImage.java:98)
  UriImage:   at com.android.gallery3d.data.UriImage.openFileOrDownloadTempFile(UriImage.java:78)
  UriImage:   at com.android.gallery3d.data.UriImage.prepareInputFile(UriImage.java:164)
  UriImage:   at com.android.gallery3d.data.UriImage.access$100(UriImage.java:40)
  UriImage:   at com.android.gallery3d.data.UriImage$RegionDecoderJob.run(UriImage.java:170)
  UriImage:   at com.android.gallery3d.data.UriImage$RegionDecoderJob.run(UriImage.java:168)
  UriImage:   at com.android.gallery3d.app.CropImage$LoadDataTask.run(CropImage.java:921)
  UriImage:   at com.android.gallery3d.app.CropImage$LoadDataTask.run(CropImage.java:913)
  UriImage:   at com.android.gallery3d.util.ThreadPool$Worker.run(ThreadPool.java:124)
  UriImage:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  UriImage:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  UriImage:   at java.lang.Thread.run(Thread.java:856)
  UriImage:   at com.android.gallery3d.util.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
  UriImage: Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
  UriImage:   at libcore.io.Posix.open(Native Method)
  UriImage:   at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
  UriImage:   at libcore.io.IoBridge.open(IoBridge.java:400)
  UriImage:   ... 16 more
  </code></pre>
  
  <p>I'm wondering if this is an internal SD card, and maybe the images are being treated as application data, so other apps can't access it?</p>