Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push my apk to /system/app

Tags:

android

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 gives me this:

"failed to copy: ... No space left on device"

Although from settings -> sdCard & Phone Storage, I get 37Mb of internal free space.

The whole point of this need is
related to permissions.

I need to have INSTALL_PACKAGES permission
and I know that by puting my application there,
in /system/app, I get that permission.

like image 277
Tsimmi Avatar asked Jan 05 '10 15:01

Tsimmi


People also ask

How do you turn an Android app into a system app?

First create a folder for your app ( Let say MyTestApp) inside packages/apps/ of your android AOSP downloaded source code. Then create a Android.mk file inside the folder(MyTestApp). Step 2 open Android.mk file and add folowing code Snippet and save this mk file. PRODUCT_PACKAGES tag at the bottom MyTestApp.

How do I change a third party app to a system app?

Inside the “/“ aka the device folder, head to the “data” and then the “app” folder to access the all the installed apps. Here, you will find the data folders of all the third-party apps listed together. Now, long press on the folder of the app that you want to convert as system app and select the “cut” option.


2 Answers

I can install an APK to /system/app with following steps.

  1. Push APK to SD card.

    $ adb push SecureSetting.apk /sdcard/  
    
  2. Enter the console and get the shell

    $ adb shell
    
  3. 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 
    
  4. Remount the system partition with WRITE permission.

    $ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system 
    
  5. Cat your APK from /sdcard/ to /system/ , some guys get a fail with cp command due to cp is not supported. So use cat instead.

    $ cat /sdcard/SecureSetting.apk > /system/app/SecureSetting.apk 
    
  6. Remout /system partition back to READ-ONLY, and exit

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

Then reboot your device, the APK should have been installed on /system/app.

like image 77
posaidong Avatar answered Oct 14 '22 02:10

posaidong


Normally, the only way to get access to the "/system/" directory is to have a device rooted. I don't exactly know if that is required for the emulator though. That could be your issue.

like image 34
Ryan Alford Avatar answered Oct 14 '22 03:10

Ryan Alford