title: How to send a command to android and then get its answer?
body: <p>I want to write <code>echo -e "AT\r" &gt; /dev/smd0</code> in the shell and then get its response.
  The response will be in <code>\dev\smd0</code>.</p>
  
  <p>I searched Google and found this :</p>
  
  <pre><code> Runtime r = Runtime.getRuntime();
              process = r.exec("su");
              process = r.exec("echo -e \"AT\\r\" &gt; /dev/smd0");
  </code></pre>
  
  <p>but it does not work.</p>
  
  <p>And I do not know how to read the response.</p>
  
  <p>If I install Terminal emulator, I can write the command and get its response with <code>cat \dev\smd0</code>.</p>