4

I'm wondering is it possible to install .apk file as system app directly (with root)? Without converting user app to system app.

0
4

You can simply copy the apk (its name not relevant) into /system/app or /system/priv-app, set the appropriate permissions (rw-r-r, root:root) and then do a reboot. That's it.

Works well on Android 6.0.1.

9
  • Can you delete the apk from /system/app folder after reboot, once it's installed? – jj_ Apr 5 '19 at 0:38
  • The presence of an APK is necessary for the app to be functional, otherwise, after removal, the app won't run, although you would continue to have the app icon in your launcher until you reboot the device. – Firelord Apr 5 '19 at 4:13
  • How exactly do you "simply copy the apk" ? And what if the app is already installed? – android developer Jul 16 '19 at 20:04
  • 1
    Use a file manager app such as Solid Explorer to copy the Apk to the location and to set permissions. If the app is already installed move (not copy) its apk from /data/app directory to the location I mentioned in the answer. A reboot would fix things on its own. @androiddeveloper – Firelord Jul 17 '19 at 5:02
  • 1
    I've now tried the "/system/app mover" app on Nexus 5 with Android 9 (custom rom of course) and BusyBox which it requires for some reason, and it converted an app to be a system app without any issues. Tried again on my Pixel 2 with Android Q, and it still showed an error that it can't do this "could not mount /system" . Odd – android developer Jul 21 '19 at 22:58
2

Via ADB: (Copy apk to phone via usb/My computer first)

Example:

adb shell                                           (Get into shell to run beow commands)
su                                                  (Run as root)
mount -o rw,remount /system                         (Mount system read/write since default it read-only)
chmod 755 /system/priv-app/Messaging_SEP81          (Set permissions on folder)
chmod -R 644 /system/priv-app/Messaging_SEP81       (Set permissions on apk file)
ls -l /system/priv-app/Messaging_SEP81              (Check permissions - Should be: -rw-r--r-- 1 root root - not sure what 1 & 2 is)
ls -l /system/priv-app | grep "Messaging"           (Check permissions - Should be: drwxr-xr-x 2 root root)
reboot                                              (Reboot device)
1
  • What if after mount -o rw,remount /system , it shows /dev/block/sda43 is read-only ? Also, what's "Messaging_SEP81" ? How can I convert an existing app to be a system app? – android developer Jul 16 '19 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.