title: Get sdcard directory by adb
body: <p>I am making an application, which pulls files(Saved by android app) from the device sdcard by adb. 
  The problem is that different devices, have various sdcard directories </p>
  
  <p>i.e:</p>
  
  <ul>
  <li>sdcard</li>
  <li>sdcard/external_sd</li>
  </ul>
  
  <p>Firstly I invented following solution:</p>
  
  <ol>
  <li>run adb shell</li>
  <li>ls</li>
  <li>Check if dir "sdcard" exists</li>
  <li>If yes run sdcard/ ls and check if external_sd exists</li>
  <li>return value.</li>
  </ol>
  
  <p>But the problem is that I have two samsung devices <code>GT-I9100</code> and <code>GT-I9000</code> and both have a directory <code>sdcard/external_sd</code>. When I am checking <code>System.getenv("EXTERNAL_STORAGE")</code> one returns <code>sdcard</code> and another <code>sdcard/external_sd</code>. I need to pull file which was previously saved to <code>System.getenv("EXTERNAL_STORAGE")</code>.</p>
  
  <blockquote>
    <p>So the question is: is there any command to get sdcard directory
    directly from adb, without access to Android code?</p>
    
    <p>Or maybe I can start activity with adb's am start, and get return
    value? Is this possible?</p>
  </blockquote>
  
  <p>EDIT:
  Found the solution:</p>
  
  <pre><code>adb shell echo $EXTERNAL_STORAGE
  </code></pre>