Installing apks via the terminal emulator

ottscay

Well-known member
Jul 16, 2010
1,010
67
0
Visit site
So, I still need to reinstall my gallery.apk, and I can't do it by just clicking on it, even with root. Can anyone tell me what the proper terminal commands would be to install the darned thing?

Thanks!
 

ottscay

Well-known member
Jul 16, 2010
1,010
67
0
Visit site
No. In fact I want to try apex, but first I want to have a fully working stock, which means I need to reinstall the gallery.apk (which was messed up by a program I was beta testing). So I can't just use the apex script :(
 

JkdJedi

Well-known member
Aug 20, 2010
2,197
218
0
Visit site
No. In fact I want to try apex, but first I want to have a fully working stock, which means I need to reinstall the gallery.apk (which was messed up by a program I was beta testing). So I can't just use the apex script :(

try this, it might work....

$su
# push gallery.apk /system/app

It might work only system/app is read only and I had to Mount the system in bootstrap in order to push a similar .apk file via ADB. It's possible though with $su

hope it works!
 

tntdroid

Droiderator
Feb 19, 2010
4,473
615
0
www.flickr.com
So, I still need to reinstall my gallery.apk, and I can't do it by just clicking on it, even with root. Can anyone tell me what the proper terminal commands would be to install the darned thing?

Thanks!

What no stock backup to flash back? If your trying to get a fresh system to backup and flash to to get ota updates id just sbf. Then backup and run apex.

Sent from my DROIDX using Tapatalk
 

ottscay

Well-known member
Jul 16, 2010
1,010
67
0
Visit site
Well, everything else is working fine, so I was just going to use this image as my backup if I could get the gallery working, then back it up. That way I don't have to sbf when I want to go back (and I don't have to reinstall apps).

Edit: that said, it didn't work, so I'll probably have to sbf :(
 

wildman

Well-known member
Jul 9, 2010
2,158
230
0
Visit site
Well, everything else is working fine, so I was just going to use this image as my backup if I could get the gallery working, then back it up. That way I don't have to sbf when I want to go back (and I don't have to reinstall apps).

Edit: that said, it didn't work, so I'll probably have to sbf :(

What SBF are you using, there's so many versions of modified versions I really haven't figured out which one is the stock untouched SBF for 2.2.1 (2.3.340)?
 
Last edited:

JkdJedi

Well-known member
Aug 20, 2010
2,197
218
0
Visit site
So, I still need to reinstall my gallery.apk, and I can't do it by just clicking on it, even with root. Can anyone tell me what the proper terminal commands would be to install the darned thing?

Thanks!

If you havnt figured this out yet and you still have this gallery.apk in your system/app, try and see if your permissions are set right. Just compare them to any other apk you got there. change them if you have to and then do a reboot, it's a coin flip.
 

wildman

Well-known member
Jul 9, 2010
2,158
230
0
Visit site
If you havnt figured this out yet and you still have this gallery.apk in your system/app, try and see if your permissions are set right. Just compare them to any other apk you got there. change them if you have to and then do a reboot, it's a coin flip.

Also if apk is still in the system/app directory you can click on the apk and it usually prompts to reinstall the app. I have been able to do that with a number of installed apps but I never tried system apps.
 

ezun

Well-known member
Jun 17, 2010
98
0
0
Visit site
Here are a couple of different options to try.

For both options you will need to put the gallery apk into the same directory as your sdk install. (if you don't know what this is try to pull a file from your device and see where it ends up. Mine is /AndroidSDK/tools because I installed the SDK in the /AndroidSDK directory on my PC)

with all of the commands to type below ignore the single quotes (')

*Install from PC*
1) connect your phone and make sure adb can detect it.
- Launch command prompt
- Navigate to your sdk directory
- type 'adb devices' - you should now see your device listed.
2) Go back to the command prompt and type 'adb install [apk name.apk]
3) You should now see a success message, if you it fails try my other option below.

*Manually place APK into /system/app*
1) connect your phone and make sure adb can detect it.
- Launch command prompt
- Navigate to your sdk directory
- type 'adb devices' - you should now see your device listed.
2) push gallery apk to your sd card.
-type 'adb push [apk name.apk] /sdcard/[apk name.apk]
3) Launch a second command prompt
-type 'adb shell'
-type 'su'
-type 'mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system'
4) go back to first command prompt
-type 'adb shell'
-type 'su'
-type 'cd /system/app'
-type 'cp /sdcard/[apk name.apk] [apk name.apk]'
-command prompt will show 'cp /sdcard/[apk name.apk] [apk name.apk]'
-type 'exit' (this will get you out of su)
-type 'exit' again (this should get you out of adb shell)
-type 'exit' again (this should close the command prompt)
5) go back to first command prompt
-type 'exit' (this will get you out of su)
-type 'exit' again (this should get you out of adb shell)
-type 'adb reboot' (this will reboot your phone)
-type 'exit' again (this should close the command prompt)

You may not need to do this in 2 command prompts, but for some reason I've had issue using just one before.

one of these should work. If not, post the errors you get and we'll work through it.
 

Trending Posts

Forum statistics

Threads
943,183
Messages
6,917,687
Members
3,158,867
Latest member
Non