Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have checked how ADB installs apps.<br> - It copies the APK to /data/local/tmp<br> - it runs 'shell:pm install /data/local/tmp/app.apk'<br> <p> I have tried to replicate this behaviour by doing: (on pc, using usb-cable)<br> <code>adb push app.apk /sdcard/app.apk</code><br> <code>adb shell</code><br> <code>$ pm install /sdcard/app.apk</code><br> This works. The app is installed. <p> I made an application (named AppInstall) which should install the other app.<br> (installed normally, non-rooted device)<br> It does:<br> <code>Runtime.getRuntime().exec("pm install /sdcard/app.apk").waitFor();</code><br> But this gives the error:<br> <code>java.lang.SecurityException: Neither user 10019 nor current process has android.permission.INSTALL_PACKAGES.</code><br> It seems like the error is thrown by pm, not by AppInstall.<br> Because the SecurityException is not catched by AppInstall and the app does not crash. <p> I've tried the same thing on a rooted device (same app and AppInstall) and it worked like a charm.<br> (Also normally installed, not in /system or anything)<br> AppInstall didn't even ask root-permission. <br> But thats because the shell is always <code>#</code> instead of <code>$</code> on that device. <p> Btw, you need root to install an app in /system, correct?<br> I tried adb remount on the non-rooted device and got: <br> <code>remount failed: Operation not permitted.</code><br> That's why I could not try the /system thing on the non-rooted device. <p> Conclusion: you should use a rooted device<br> Hope this helps :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload