Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
205 views
in Technique[技术] by (71.8m points)

android - Push my apk to /system/app

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...