Push my apk to /system/app

前端 未结 14 2099
清酒与你
清酒与你 2020-12-02 07:16

How can I push my application package to Android emulator \"/system/app\" folder?

I\'ve already tried to use:
\"adb push myApk.apk /system/app\"
and it giv

14条回答
  •  暖寄归人
    2020-12-02 07:36

    These are the steps if you are installing a system apk for Android 5.0 or later devices. For older versions use posaidong's answer

    Rename your apk file to base.apk

    $ adb push base.apk /sdcard/  
    

    Enter the console and get the shell

    $ adb shell
    

    Switch to superuser. If your device is not rooted, get it rooted first. (If you don't know how to do that, just Google.)

    $ su 
    

    Remount the system partition with WRITE permission.

    $ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system 
    

    Create a Test directory inside /system/app folder. (or can use /system/priv-app as well). Ideally this folder name should be application name. For now, lets use Test

    $ mkdir /system/app/Test 
    

    Requires 755 permission for this dir

    $ chmod 755 /system/app/Test 
    

    Copy your base.apk inside

    $ cat /sdcard/base.apk > /system/app/Test/Base.apk 
    

    Remout /system partition back to READ-ONLY, and exit

    $chmod 644 /system/app/Test/Base.apk 
    

    Requires 644 permission for this dir

    $ mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
    
    $ exit
    

    Reboot your device. When boot completes you should see a system message like Android updating ...

提交回复
热议问题