title: Android shell commands
body: <p>When I SSH into my android phone and run the command "ps | grep facebook" I get the proper output...</p>
  
  <pre><code>23394 app_25     0:26 com.facebook.katana
  23432 app_25     0:02 com.facebook.katana:providers
  25073 root       0:00 grep facebook
  </code></pre>
  
  <p>However if I run the same command through Java using Runtime.getRuntime().exec("ps | grep facebook"); I end up getting...</p>
  
  <pre><code>USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAMEapp_25    23394 111   169388 53420 ffffffff 00000000 S com.facebook.katana
  </code></pre>
  
  <p>What I am looking for specifically is the time just to the left of com.facebook.katana</p>
  
  <p>Here is the code I am using...</p>
  
  <pre><code>private String getResultFromCommandLine(String command)
  {
      StringBuilder sb = new StringBuilder();
  
      String temp;
  
      try
      {
          Process process = Runtime.getRuntime().exec(command);
          BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
  
          while ((temp = bufferedReader.readLine()) != null)
          {
              sb.append(temp);
          }
      }
      catch (IOException e) { }
  
      return sb.toString();
  }
  </code></pre>
  
  <p>Does anyone know why I am not getting the same output?</p>