title: Installing an APK using pm command
body: <p>I tried updating an APK using this code:</p>
  
  <pre><code>Process process;
  process = Runtime.getRuntime().exec(new String[] {"su", "-c", "pm install -r -d"+MyApk.apk});
  </code></pre>
  
  <p>but it does not work.</p>
  
  <p>This works well when I use it with adb like:</p>
  
  <pre><code>adb shell su -c pm install -r -d /system/app/Community-debug.apk
  </code></pre>
  
  <p>It also works fine if it has to ask for user permission in order to install like using the intent method.</p>