Android Package Installer

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
So, I currently have a Motorola Razr XT925 HD. I rooted it and was deleting some stuff. I may have kind of possibly not so accidentally deleted the package installer, so now I can't install anything onto my phone. I was reading somewhere a little while ago that there should be a way to install stuff directly from your computer but you need specific programs, yada yada yada. If someone could walk me through that, or if someone has a much easier way of making it so I can install things onto my phone again that would be fantastic!
 

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,575
Trophies
2
Age
29
Location
I forgot
Website
POCKET.LIKEITS
XP
19,220
Country
United States
There are a couple ways to do it, actually. You can put the packagerinstaller.apk on your SD card then use a root explorer (like ES File Explorer) to move it to /system/app. Then just restart your phone, and it should work from there. Done it hundreds of times with Trebuchet launcher on non-CM ROMs, works fine.

You can also use ADB on PC to push the apk file directly to /system/app as well.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
There are a couple ways to do it, actually. You can put the packagerinstaller.apk on your SD card then use a root explorer (like ES File Explorer) to move it to /system/app. Then just restart your phone, and it should work from there. Done it hundreds of times with Trebuchet launcher on non-CM ROMs, works fine.

You can also use ADB on PC to push the apk file directly to /system/app as well.

Sorry, but I'm a little confused on how that works. Don't .apk files have to be installed onto your phone before they can be moved to system apps?
 

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,575
Trophies
2
Age
29
Location
I forgot
Website
POCKET.LIKEITS
XP
19,220
Country
United States
It's a bit complicated, really, and I know I probably won't explain it right...but....Think of APKs like .jar files, they're archives that hold all the resources and assets and such all in one file that can be run from the system. Generally when you install an app, it'll move the APK to /data/apps and will then create a data directory in /data/data that holds all the settings and any other file generated by the APK. Large games like...Half Life or something require separate resources that must be downloaded with the APK, generally the APK will be small and then the app itself will download and move the files to /sdcard/Android/obb (or /data).

System apps are generally small, and don't require any additional files (since they're usually packaged with Android itself). Here's a screenshot of the /system/app directory on my Shield:

ebf0JBD.png

Just a bunch of APK files.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
It's a bit complicated, really, and I know I probably won't explain it right...but....Think of APKs like .jar files, they're archives that hold all the resources and assets and such all in one file that can be run from the system. Generally when you install an app, it'll move the APK to /data/apps and will then create a data directory in /data/data that holds all the settings and any other file generated by the APK. Large games like...Half Life or something require separate resources that must be downloaded with the APK, generally the APK will be small and then the app itself will download and move the files to /sdcard/Android/obb (or /data).

System apps are generally small, and don't require any additional files (since they're usually packaged with Android itself). Here's a screenshot of the /system/app directory on my Shield:

ebf0JBD.png

Just a bunch of APK files.

Gotcha. So, if I have downloaded the packageinstaller.apk, how would I use the ADT program to move it directly to system/apps?
 

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,575
Trophies
2
Age
29
Location
I forgot
Website
POCKET.LIKEITS
XP
19,220
Country
United States
ADB* There are some adb standalone installs, so you don't need to install the entire Android SDK, so that's an option to get ADB as well.

Download the drivers for your phone.
Turn USB Debugging mode on (it's in Developer Mode in the settings, if Dev mode isn't there go to Settings->About and find "Build Number" and tap it until Dev mode is enabled).
Plug your phone into your PC.
Open CMD prompt, cd to where adb.exe is in the Android SDK install folder (should be in x/Android/android-sdk/platform-tools), move the packageinstaller.apk to the same directory.
Type in "adb devices", it should attempt to connect to your phone.
Once it does, type "adb push packageinstaller.apk /system/app" .
It'll then send the apk to your /system/app directory. After that, restart your phone and it should be back again.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
ADB* There are some adb standalone installs, so you don't need to install the entire Android SDK, so that's an option to get ADB as well.

Download the drivers for your phone.
Turn USB Debugging mode on (it's in Developer Mode in the settings, if Dev mode isn't there go to Settings->About and find "Build Number" and tap it until Dev mode is enabled).
Plug your phone into your PC.
Open CMD prompt, cd to where adb.exe is in the Android SDK install folder (should be in x/Android/android-sdk/platform-tools), move the packageinstaller.apk to the same directory.
Type in "adb devices", it should attempt to connect to your phone.
Once it does, type "adb push packageinstaller.apk /system/app" .
It'll then send the apk to your /system/app directory. After that, restart your phone and it should be back again.

When I type adb devices it says adb is not a recognized as an internal or external command.

I don't want you to go to too much work. I'm trying to do this on Windows. But a step-by-step process would be nice. I am really confused :/
 

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,575
Trophies
2
Age
29
Location
I forgot
Website
POCKET.LIKEITS
XP
19,220
Country
United States
The only time that would happen is if you weren't in the directory of adb.exe in the CMD prompt.

Try holding shift, right clicking in the same directory as adb.exe, and pick "Open a command line window here", then continue with the ADB stuff. The above is literally the step by step.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
The only time that would happen is if you weren't in the directory of adb.exe in the CMD prompt.

Try holding shift, right clicking in the same directory as adb.exe, and pick "Open a command line window here", then continue with the ADB stuff. The above is literally the step by step.

Okay, wait. I got most of it. I understand. This is the last issue I'm having. It says it failed to copy packageinstaller.apk because it's a read-only file system.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
Ok, try pushing the apk to /sdcard/Download, then try using /system/app Mover to move the apk to the /system/app directory on your phone.

One second. I typed adb root and then adb su and now it's not able to find my device. Should I just close the cmd prompt and try again? This is the messages I have right now:
Help1.png
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
Do you have any terminal or file explorer with root access installed? Either one will do the job.

All I got is /system/app Mover, and App Master. As far as I'm aware anyways.


Ok, try pushing the apk to /sdcard/Download, then try using /system/app Mover to move the apk to the /system/app directory on your phone.
The problem with that is, as far as I can tell, /system/app Mover doesn't access the SD card.
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
Ok I thought up another way around your problem. Put this zip on the root of your internal storage and rename it update.zip. Next reboot into recovery (CWM or TWRP) and install the zip from there and reboot. It should then reinstall the apk during boot up.
 

Castiel

Well-Known Member
OP
Member
Joined
Oct 15, 2010
Messages
502
Trophies
1
Age
28
Location
Ba Sing Se
XP
469
Country
Canada
Ok I thought up another way around your problem. Put this zip on the root of your internal storage and rename it update.zip. Next reboot into recovery (CWM or TWRP) and install the zip from there and reboot. It should then reinstall the apk during boot up.

The link doesn't lead me to a download. Just to a black screen that says there should be a packageinstaller.zip.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @Psionic Roshambo, Thats pretty cool.