Android - How do I properly install a system app given its .apk?
You will need to push the .apk to the phone to the System partition to the folder
/system/priv-app when using Android 4.3 using
adb. You can find more info about
adb here: http://android-dls.com/wiki/index.php?title=ADB.
In order to write to
/system you likely have to remount it read-write:
mount -o rw,remount /system
Or, do it entirely from the host's ADB:
Now you can place the
adb push my-app.apk /sdcard/
mv my-app.apk /system/app
# or when using Android 4.3 or higher
mv my-app.apk /system/priv-app
Afterwards if the flags are not already set change the permissions. All System-Apps need to have the permissions
rw-r--r--. You can also change them via ADB with the command
chmod 644 /path_to/your_file. Though it's quite old, this may help
After you have placed the
.apk you need to reboot your device. For example with
Carl Parker writes about it on Android Authority:
(partly reproduced here in case the original post goes down)
For Apps Installed on the Device
- Type the command
ls appfilename*(where “appfilename” is the app’s ID on Google Play Store; make sure you include the asterisk at the end). This command will display the app’s complete APK filename.
- Enter the following command:
mv apk_full_filename_here /system/app/apk_full_filename_here
- The device will now reboot. Your app is now saved as a system app.
For Apps Whose APKs Are on the PC Hard Drive
- Open a command prompt on your computer and navigate to where the APK file is located.
- Enable USB debugging on your device and connect your device to the computer via USB cable.
- Enter the following commands:
adb push apk-filename-here /system/app/
adb shell chmod 644 /system/app/apk-filename-here
Your phone will automatically reboot. Your app will now be saved as a system app.
note that when playing with adb you will install apps via their package file name (meaning, at the command prompt you will type >adb install myFile.apk)
but you will uninstall them via their package name (>adb uninstall com.this.that.otherthing)
You won't be able to install a package until you've uninstalled its predecessor.
It'll help to add adb to your PATH so that you can just go to the directory where the .apk file is and type adb install myFile.apk.