Tapa Save
Tapa Save

Reputation: 4857

How to make my application system

I need create my app as system, because i need get permission android.permission.WRITE_SECURE_SETTINGS. After install to virtual device (Eclipse) my app appears in '/data/app'. I try manually move him to '/system/app', set rights 644, but when i launch my app - toast 'App isn't installed'. After reboot (close virtual device and restart) my app disappeared from '/system/app'.

Add: - 1. Why android can not see my application in '/system/app'? - 2. Why after restart virtual device my app disappeared from '/system/app'?

What the best way make my app system on Eclipse Emulator and real devices?

Upvotes: 8

Views: 21131

Answers (4)

user6264840
user6264840

Reputation:

If the device is not rooted, you cannot copy anything to the System or Data partitions.

With root do the following commands in a command prompt or linux shell and all should be fine:

adb push fileName /data/local/tmp
adb shell
su
mount -o remount, rw /system
cp /data/local/tmp/fileName /system/folderOfYourChoise
chmod 644 (if its an apk and you want the system to use it as a system app)
exit (exits the su shell)
exit (exits the adb shell)
adb reboot (to apply and see changes on the device)

Upvotes: 0

Antrromet
Antrromet

Reputation: 15414

You cannot make your app by default as the system app. There are some other ways though through which you could make other normal apps as system apps on rooted phones.

You 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. As stated here.

Upvotes: 2

indraja machani
indraja machani

Reputation: 679

You can't make an application as system app on emulator.But you can make an app as system app on device.For that, you need to have the git repo set up on your pc,and after setting up repo, copy the app folder in repo folder/packages/apps and put it for compile.and you will get system.img in out folder of repo.Then you can flash the system.img on sd card, so that you will get your app as a system app.And this is the only way is there to make an app as system app.

Upvotes: 0

Nirav Tukadiya
Nirav Tukadiya

Reputation: 3417

The apps installed on your Android devices can be broadly categorized as system apps or user apps, based on their installation location. The user apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.

System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible. The process isn’t as hard as it may sound. However, there is a catch.

In order to install an app as a system app on your Android device, your device must either be rooted, or have a custom recovery installed (or both). Usually pretty much everyone who has a custom recovery installed uses a rooted ROM, so we’ll just be using the method for rooted phones. Go to below tutorial.it might help you.

Make Your app System App

Upvotes: 5

Related Questions