How do install a apk from adb command line?

Search This thread

Keypel

Member
Feb 15, 2012
9
15
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.
 
Last edited:

ragepekr

Member
Dec 6, 2010
11
17
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
 

Keypel

Member
Feb 15, 2012
9
15
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.
 
Last edited:

liuhuiyan2010

New member
Dec 22, 2011
4
6
Singapore
$ 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 ".
 

Keypel

Member
Feb 15, 2012
9
15
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.
 
Last edited:

Keypel

Member
Feb 15, 2012
9
15
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.
 

fykos

New member
Sep 26, 2012
1
0
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
 

cwkhong

Senior Member
Jan 3, 2008
136
8
i want to install launcher via pc becos i forgetfully uninstall all the launchers in the system. now tab doesn't start just showing 'samsung'. i don.t want to flash again becos i want to keep everything in the sd card (not external card). if i flash everything will be gone. any help?
 

nikolas22t

Member
Oct 4, 2012
10
0
i have a clone n7100 and i removed from root explorer the nova launcher (default launcer) and every time i factory reset i need to reinstall with adb , is there a way to permanent install it ?
 

callihn

Senior Member
Oct 14, 2012
157
31
Quick question for anyone that knows... Is pm smart enough for upgrades? This would be ideal for play services if it can handle that to get the updated version into the system if it works?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    It's: adb install /path/to/app.apk

    Check this out:

    http://developer.android.com/guide/developing/tools/adb.html#commandsummary

    It has all the commands and syntax
    12
    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
    9
    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.
    6
    $ 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 ".
    5
    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.