title: Android Install apk silently by busybox command-line
body: <p>I want to install .apk silently in background by BusyBox command. I`ve seen some similar questions like <a href="https://stackoverflow.com/questions/12598687/install-apk-in-background-using-busybox">THIS</a>, but I still cant get working my code properly...</p>
  
  <p>I have:</p>
  
  <ol>
  <li>My .apk I need to install on /sdcard/download/app.apk</li>
  <li>Root</li>
  <li>BusyBox installed</li>
  </ol>
  
  <p>Code (not working):</p>
  
  <pre><code>String sss = Environment.getExternalStorageDirectory() + "/download/" + "app.apk";
  Process install;
  install = Runtime.getRuntime().exec("/system/xbin/busybox pm install " + sss); 
  int success = install.waitFor();
  </code></pre>
  
  <p>If I use "install" instead of "pm install" it copies file well.</p>
  
  <p>P.S. Code above is executing in AsyncTask. No errors, but also nothing happens...
  Please help!</p>
  
  <p>Also I tried this, but I`m getting exit value 139 and no result:</p>
  
  <pre><code>        Process process;
          process = Runtime.getRuntime().exec("su");
          DataOutputStream os = new DataOutputStream(process.getOutputStream());
          os.writeBytes("pm install /mnt/sdcard/app.apk\n");
          os.flush();
          os.writeBytes("exit\n");
          os.flush();
  
          int i = process.waitFor();
  </code></pre>