FORUMS

How do install a apk from adb command line?

9 posts
Thanks Meter: 15
 
By Keypel, Junior Member on 15th February 2012, 02:49 AM
Post Reply Email Thread
SOLVED

How do install a *.apk from adb command line?

First I tried to cp the *.apk from /sdcard/backups/apps to /system/app (after rw mounting the file system of course)

I did successfully move it to /system/app but the *apk was not "installed"

then I rm it and tried:

install /sdcard/backups/appa/<package>.apk /system/app

and it copied the *apk to /system/app but still was not "installed"

I also tried:

install /system/app/<package>*apk but got the error dialog:

Code:
BusyBox v1.19.0.git.adrynalyne (2010-12-21 22:03:30 MST) multi-call binary.

Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [SOURCE]... DEST

Copy files and set attributes

Options:
	-c	Just copy (default)
	-d	Create directories
	-D	Create leading target directories
	-s	Strip symbol table
	-p	Preserve date
	-o USER	Set ownership
	-g GRP	Set group ownership
	-m MODE	Set permissions
My goal is to figure out how to use adb command line and also I want to install an app as if it were a pre-installed app. For example pre-installed apps don't show up as a removable app and stay installed after a factory reset.
The Following 9 Users Say Thank You to Keypel For This Useful Post: [ View ] Gift Keypel Ad-Free
15th February 2012, 03:02 AM |#2  
Junior Member
Thanks Meter: 4
 
More
Pretty sure it's adb push *.apk /system/app/*.apk

I'm pretty novice but I use it when I'm setting up my tablets with Root Explorer and it works.
The Following 4 Users Say Thank You to djjustfrank For This Useful Post: [ View ] Gift djjustfrank Ad-Free
15th February 2012, 03:36 AM |#3  
smokin1337's Avatar
Retired Recognized Developer
Flag Virginia
Thanks Meter: 1,615
 
Donate to Me
More
It's: adb install /path/to/app.apk

Check this out:

http://developer.android.com/guide/d...commandsummary

It has all the commands and syntax
The Following 26 Users Say Thank You to smokin1337 For This Useful Post: [ View ] Gift smokin1337 Ad-Free
15th February 2012, 03:39 AM |#4  
Junior Member
Thanks Meter: 17
 
More
what kind of app??

System app is just copy to your system/app folder.
and set permition to 644 (rw-r--r--)
Adb push *.apk /system/app

Normal apk is
Adb install *.apk

that's all.

I can explain more if you tell me about what kind app and your system(window or linux)

Sent from my SHW-M250S using XDA App
The Following 12 Users Say Thank You to ragepekr For This Useful Post: [ View ] Gift ragepekr Ad-Free
15th February 2012, 03:41 AM |#5  
OP Junior Member
Thanks Meter: 15
 
More
I don't have push. I have pushd. is pushd the same as push? I'm guessing not. I think pushd is for directories.

I was just experimenting with AK_Notpad.apk. Also I did set AK_Notpad.apk to 644 before even asking in this thread. I noticed the permissions were funky so I changed them to 644 to match all the other apk's that were in system/app

I'm trying to figure out how to install an apk as if it were a pre-installed app. (i.e app doesn't show as removable and stays installed after a factory reset)

PS I'm a linux user.
15th February 2012, 03:42 AM |#6  
Junior Member
Thanks Meter: 17
 
More
If you using android terminal.
try this

pm install *.apk

Sent from my SHW-M250S using XDA App
The Following 4 Users Say Thank You to ragepekr For This Useful Post: [ View ] Gift ragepekr Ad-Free
15th February 2012, 03:48 AM |#7  
Junior Member
Singapore
Thanks Meter: 6
 
More
$ adb install *.apk

It will appear "Success" when finish.

or you can cp the apk to sdcard using file transfer or "adb push".
than click to run in your android device's file manager, it will start the installation.

---------- Post added at 04:48 AM ---------- Previous post was at 04:44 AM ----------

ok, I got it. You were using "adb shell".
Don't go into the adb shell, just in your cmd(windows) or terminal(linux).
place your apk in your host PC, not android device, type "adb install *.apk ".
The Following 6 Users Say Thank You to liuhuiyan2010 For This Useful Post: [ View ] Gift liuhuiyan2010 Ad-Free
15th February 2012, 03:56 AM |#8  
OP Junior Member
Thanks Meter: 15
 
More
Quote:

ok, I got it. You were using "adb shell".
Don't go into the adb shell, just in your cmd(windows) or terminal(linux).
place your apk in your host PC, not android device, type "adb install *.apk "

yes, I was using adb shell....

Ok that worked... (Thank You) using "adb install" from a terminal (not adb shell) works for installing. (PS how do you set the permissions i.e Storage and Networking permissions it needs)

but how are pre-installed apps installed? I know they are in /system/app but how do I install them to /system/app? Moving them to /system/app does not install them.

I'm trying to make it so that I can install an app and it stays even after a factory reset. For example superuser.apk stays installed even after a factory reset.

I tried:

adb push /home/user-01/Desktop/AK\ Notepad_2.3.6.apk /system/app

but it only copied the apk to /system/app, but it did not install.
15th February 2012, 05:38 AM |#9  
OP Junior Member
Thanks Meter: 15
 
More
I got it! Thanks Everyone!

The main problem is that for what ever reason apk's that are in the /system/app folder cannot contain spaces.

I renamed the apk from "AK Notepad.apk" to "AK_Notepad" while the file was on my Desktop and then:

adb push <path/to/file.apk> /system/app
chmod 644 /system/app/AK_Notepad.apk
and then a "reboot"

(of course you have to make the file system writable first)

If you don't get rid of the spaces in the file name, it will only copy the file instead of copy and install.
The Following 5 Users Say Thank You to Keypel For This Useful Post: [ View ] Gift Keypel Ad-Free
26th September 2012, 03:01 PM |#10  
Junior Member
Thanks Meter: 0
 
More
Install_failed_invalid_apk
Olá, estou com um tablet IBAK-787 Android Uberoid 2.2 Kernel 2.6.32 Build Number 1.5.5 fiz a conexão pelo adb certinho. e na hora que vou instalar o apk "adb install adobeair.apk" aparece a mensagem [INSTALL_FAILED_INVALID_APK] e pesquisando na internet esse erro diz que é porque o tablet não é certificado pela adobe. alguem saberia o que devo fazer pra conseguir instalar o adobe air neste tablet? Obrigado
21st March 2013, 12:16 AM |#11  
alexwoellhaf's Avatar
Member
Flag Muskegon
Thanks Meter: 3
 
Donate to Me
More
Quote:
Originally Posted by smokin1337

It's: adb install /path/to/app.apk

Check this out:


It has all the commands and syntax


Confirmed Working
The Following User Says Thank You to alexwoellhaf For This Useful Post: [ View ] Gift alexwoellhaf Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes