title: Running a shell script on android device using adb
body: <p>Manually, we can run:</p>
  
  <pre><code>adb shell
  su
  chmod 666 /dev/graphics/fb0
  export CLASSPATH=/data/local/device.jar
  export LD_LIBRARY_PATH=/data/local
  exec app_process /system/bin com.device.client.Main /data/local/device.conf &amp;
  </code></pre>
  
  <p>However, we need to be able to run that from a bash script on the computer compiling the program.</p>
  
  <p>I have tried:</p>
  
  <pre><code>adb shell "su
      &amp;&amp; chmod 666 /dev/graphics/fb0
      &amp;&amp; export CLASSPATH=/data/local/device.jar
      &amp;&amp; export LD_LIBRARY_PATH=/data/local
      &amp;&amp; exec app_process /system/bin com.device.client.Main /data/local/device.conf &amp;"
  </code></pre>
  
  <p>But since we are entering the su shell, this does not work.</p>
  
  <p>Can you please suggest a solution?</p>