Batch install APKs from ADB in Android. EASY!!

Search This thread

dannycurtean

New member
Aug 3, 2010
1
27
I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.

My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!

So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.

To do this its simple, just write your own batch script and run adb install.

You will need:

1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**

Now, I assume you already have the APK bunch on your SD card, like I had.

I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).

Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.

Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"

Example:
Code:
cd..
cd..
cd apps

Now you should see your path set as "C:\apps" in CMD.

Step 2.
Create directory print.

In CMD "C:\apps" run:
Code:
dir /s /b > print.txt
This will print all directory files and extensions but nothing else, like size and attributes into your "C:\apps" folder. Now you will see a "print.txt" file in your "c:\apps" folder. If you open it, you will see a list of all your APKs.

Step 3.
Assuming you are using Notepad to view your "print.txt" file, press "CTRL+H". This will open the Find and Replace dialog box.

In Find type
Code:
C:\

In replace type
Code:
adb install -r c:\

Hit enter and it will modify all the APKs with the adb install command. Save and close notepad.

Step 4.
Now you need to rename that .txt extension in your "c:\apps\print.txt" to "print.bat". You need to have extension shown in windows. Google that if you dont know how to do that.

Once saved as a .bat file, simply execute and it will run through the sequence to install all your APK files without any prompts on your phone. Voila, and enjoy.

EXAMPLE:"c:\apps\print.bat"
Code:
adb install -r c:\apps\com.twitter.android-1.apk
adb install -r c:\apps\com.ups.mobile.android-2.apk
adb install -r c:\apps\com.vavni.android.battleship-1.apk
adb install -r c:\apps\com.viclabs.myRemote-2.apk
adb install -r c:\apps\com.waterflea.wifiscan-1.apk
adb install -r c:\apps\com.wyse.pocketcloud-1.apk
adb install -r c:\apps\com.xrath.jmsn-2.apk
adb install -r c:\apps\com.xtralogic.android.rdpclient-1.apk
adb install -r c:\apps\com.xtremelabs.android.speedtest-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.im-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.mail-2.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.search-1.apk
adb install -r c:\apps\hongbo.bluescreen-1.apk
adb install -r c:\apps\info.marlan.sim-1.apk
adb install -r c:\apps\koushikdutta.telnet-1.apk
adb install -r c:\apps\kr.mobilesoft.yxplayer-2.apk
adb install -r c:\apps\net.mafro.android.wakeonlan-1.apk
adb install -r c:\apps\nl.rogro.GScript-1.apk
adb install -r c:\apps\org.ajeje.fakelocation-1.apk
adb install -r c:\apps\org.ale.abtc-1.apk
adb install -r c:\apps\org.android7.aviplayer-1.apk
adb install -r c:\apps\org.connectbot-1.apk
adb install -r c:\apps\org.gmote.client.android-1.apk
adb install -r c:\apps\org.iii.ro.meridian-1.apk
adb install -r c:\apps\org.kman.WifiManager-1.apk
adb install -r c:\apps\org.openobjectives.serverassistant-1.apk
adb install -r c:\apps\org.prowl.networkmapper-1.apk
adb install -r c:\apps\org.transdroid-1.apk

This will go in sequence and show "success" when finished installing. It will then run the next command in sequence until its done.

** I tried to write this thread as a help to those trying to do the same thing I was trying to do. This is in no way meant to validate anything and is meant merely as a resource to anybody. If your going to be an ass, shove it, if you like it, im happy I could help.**
 
Last edited:
A

AdrianK

Guest
Wow, that certainly is an interesting solution. Personally I just push everything to data/app when in recovery, wipe dalvik-cache, then reboot, always works fine.
 

greddy

Senior Member
Jan 10, 2005
475
49
München
www.gadgetfreak.de
hello,

i know i am off topic but i dont find only this thread with the app i am searching.

i search for the "ups mobile" app and the market on my desire (froyo 2.2) found this app not. (Sorry for my english) The app is free, no warez!

Can anyone send my the app or an link with the app ?

many thanks and sorry for off topic.

peter
 

Matt105

Senior Member
Oct 3, 2009
163
9
Thanks for the advice. However, I have about 50 apks to backup and Astro is unable to backup like 15 of them. IE Crystallight Defense. It just says it's unable to do it and I don't know why. Thanks for any help.
 

darkcell

Senior Member
Mar 31, 2004
137
4
kewly.deviantart.com
this is simplest method yet...

copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:

=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================

regards,
d4rkcell
 

spartan062984

Senior Member
Oct 8, 2010
249
7
Install apk

Hello Fellow Androids!

If this is off topic, please accept my apologies. I am searching through all of XDA for a simple solution to adding apk. Now before you start bashing, please keep in mind that I am well aware of the "search" options + google + XDA etc.

Long story short, I have:

1) Rooted
2) Fashed many Roms (currently on Stock 2.1)
3) Lag Fixxed (see signature)
4) Removed Bloatware
5) I am familiar with ABD and commands

Problem:

All I'm trying to do is install certain "apk"s using ADB. I am well aware of the Program that installs/ pushes apps automatically that are found in G1 + Vibrant + HTC + Droid Forums without having to do any typin......BUT.....I would like to know my way around ABD <----Main reason why i dont want the easy way out.

I have been here:

http://forum.xda-developers.com/showthread.php?t=716806

as well as here:

http://forum.xda-developers.com/showthread.php?t=743457

even been here:

http://forum.xda-developers.com/showthread.php?t=740545

I know what you are thinking, why not use them? As i said before, i would like to be efficient with ADB. So...


I have tried methods found here:

http://forum.xda-developers.com/showthread.php?t=517874

As well as:

http://forum.xda-developers.com/showthread.php?t=532719


The problem I am having is:

Whether i navigate to my folder (desktop with all my apps) and use either

"adb push app /system/sd/app
adb push app-private /system/sd/app-private"

or simply

"adb install <path to file> - Example: adb install c:/apps/apps2sd.apk"

I always get the error: "cant find <whatever apk> to install"

No matter which directory i have it, i get that message.

Note:

1) I have debugging on
2) I mounted sd <----also tried Without mounting
3) I have used the same command when I removed bloatware but i understand Adding apks are slightly different.
4) I have all the drivers installed + Microsoft's .net framework + etc

What am i doing wrong?

All Critics, input, education bashing (just not hating) lol are welcome. Thanks!
 

Val3r10

Senior Member
Jul 6, 2006
227
6
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**
Very nice, thanks.
Is there any way to make installed APKs being seen by Market ?
I mean, is it possible to relink all the batch-installed .apk files as they were installed from Android market ?

If not, this method is fine at first but becomes painful with all the lost market updates

Thanks a lot
 

k.mooijman

Member
Mar 24, 2007
29
1
this is simplest method yet...

copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:

=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================

regards,
d4rkcell



Thanks a lott for this !!!!
having about 260 apps installed it saves me several hours to reinstall after updating to froyo !!
 

fiddlermikey

Member
Jul 1, 2008
9
1
Even easier.

Thanks for the great information. I realize you can save yourself a few steps after gathering all the apk's in one location by using this command line (XP or higher):

Step 2. In the Android SDK folder containing adb, type:
Code:
for %f in (c:\apps\*.apk) do @(echo adb install -r %f)

I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.

My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!

So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.

To do this its simple, just write your own batch script and run adb install.

You will need:

1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**

Now, I assume you already have the APK bunch on your SD card, like I had.

I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).

Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.

Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"
 
  • Like
Reactions: Cyb0rgz

peliopoulos

Senior Member
Nov 15, 2005
67
11
Prince George
this is simplest method yet...

copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:

=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================

regards,
d4rkcell

This looks like a great solution. Is there some way to run this from the phone itself? When I tried using Terminal Emulator in ICS, I get a Segmentation Fault error.
 

kaybee327

Member
Sep 13, 2010
30
4
Hi to spartan062984

Couple of suggestions which I found to work.

Copy adb.exe to \windows\system32.--- this will give you a global adb which works from any directory.

Make a folder 'APK' ( or what you wish ) and put your apk's into it.

In DOS cd to APK and then run your install e.g. adb install xyz.apk \app

Hope it works for you

Keith
 
Last edited:

Eve_brea

Senior Member
May 20, 2012
151
5
I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.

My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!

So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.

To do this its simple, just write your own batch script and run adb install.

You will need:

1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**

Now, I assume you already have the APK bunch on your SD card, like I had.

I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).

Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.

Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"

Example:
Code:
cd..
cd..
cd apps

Now you should see your path set as "C:\apps" in CMD.

Step 2.
Create directory print.

In CMD "C:\apps" run:
Code:
dir /s /b > print.txt
This will print all directory files and extensions but nothing else, like size and attributes into your "C:\apps" folder. Now you will see a "print.txt" file in your "c:\apps" folder. If you open it, you will see a list of all your APKs.

Step 3.
Assuming you are using Notepad to view your "print.txt" file, press "CTRL+H". This will open the Find and Replace dialog box.

In Find type
Code:
C:\

In replace type
Code:
adb install -r c:\

Hit enter and it will modify all the APKs with the adb install command. Save and close notepad.

Step 4.
Now you need to rename that .txt extension in your "c:\apps\print.txt" to "print.bat". You need to have extension shown in windows. Google that if you dont know how to do that.

Once saved as a .bat file, simply execute and it will run through the sequence to install all your APK files without any prompts on your phone. Voila, and enjoy.

EXAMPLE:"c:\apps\print.bat"
Code:
adb install -r c:\apps\com.twitter.android-1.apk
adb install -r c:\apps\com.ups.mobile.android-2.apk
adb install -r c:\apps\com.vavni.android.battleship-1.apk
adb install -r c:\apps\com.viclabs.myRemote-2.apk
adb install -r c:\apps\com.waterflea.wifiscan-1.apk
adb install -r c:\apps\com.wyse.pocketcloud-1.apk
adb install -r c:\apps\com.xrath.jmsn-2.apk
adb install -r c:\apps\com.xtralogic.android.rdpclient-1.apk
adb install -r c:\apps\com.xtremelabs.android.speedtest-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.im-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.mail-2.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.search-1.apk
adb install -r c:\apps\hongbo.bluescreen-1.apk
adb install -r c:\apps\info.marlan.sim-1.apk
adb install -r c:\apps\koushikdutta.telnet-1.apk
adb install -r c:\apps\kr.mobilesoft.yxplayer-2.apk
adb install -r c:\apps\net.mafro.android.wakeonlan-1.apk
adb install -r c:\apps\nl.rogro.GScript-1.apk
adb install -r c:\apps\org.ajeje.fakelocation-1.apk
adb install -r c:\apps\org.ale.abtc-1.apk
adb install -r c:\apps\org.android7.aviplayer-1.apk
adb install -r c:\apps\org.connectbot-1.apk
adb install -r c:\apps\org.gmote.client.android-1.apk
adb install -r c:\apps\org.iii.ro.meridian-1.apk
adb install -r c:\apps\org.kman.WifiManager-1.apk
adb install -r c:\apps\org.openobjectives.serverassistant-1.apk
adb install -r c:\apps\org.prowl.networkmapper-1.apk
adb install -r c:\apps\org.transdroid-1.apk

This will go in sequence and show "success" when finished installing. It will then run the next command in sequence until its done.

** I tried to write this thread as a help to those trying to do the same thing I was trying to do. This is in no way meant to validate anything and is meant merely as a resource to anybody. If your going to be an ass, shove it, if you like it, im happy I could help.**

This works good so far.. lets hope that system process likes it.
trying now.
 

Slytheer

Member
Mar 26, 2010
34
11
this is simplest method yet...

copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:

=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================

regards,
d4rkcell

I love simple solutions in linux :D
You have killed all 100km long tutorials and apps :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.

    My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!

    So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.

    To do this its simple, just write your own batch script and run adb install.

    You will need:

    1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
    Code:
    youtube.com/watch?v=A1SOSXwkc_8
    2. USB Cable to PC
    3. Enable "USB Debugging" on phone
    **Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**

    Now, I assume you already have the APK bunch on your SD card, like I had.

    I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).

    Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.

    Step 1.
    Open command prompt (CMD) and change directory to your "c:\apps"

    Example:
    Code:
    cd..
    cd..
    cd apps

    Now you should see your path set as "C:\apps" in CMD.

    Step 2.
    Create directory print.

    In CMD "C:\apps" run:
    Code:
    dir /s /b > print.txt
    This will print all directory files and extensions but nothing else, like size and attributes into your "C:\apps" folder. Now you will see a "print.txt" file in your "c:\apps" folder. If you open it, you will see a list of all your APKs.

    Step 3.
    Assuming you are using Notepad to view your "print.txt" file, press "CTRL+H". This will open the Find and Replace dialog box.

    In Find type
    Code:
    C:\

    In replace type
    Code:
    adb install -r c:\

    Hit enter and it will modify all the APKs with the adb install command. Save and close notepad.

    Step 4.
    Now you need to rename that .txt extension in your "c:\apps\print.txt" to "print.bat". You need to have extension shown in windows. Google that if you dont know how to do that.

    Once saved as a .bat file, simply execute and it will run through the sequence to install all your APK files without any prompts on your phone. Voila, and enjoy.

    EXAMPLE:"c:\apps\print.bat"
    Code:
    adb install -r c:\apps\com.twitter.android-1.apk
    adb install -r c:\apps\com.ups.mobile.android-2.apk
    adb install -r c:\apps\com.vavni.android.battleship-1.apk
    adb install -r c:\apps\com.viclabs.myRemote-2.apk
    adb install -r c:\apps\com.waterflea.wifiscan-1.apk
    adb install -r c:\apps\com.wyse.pocketcloud-1.apk
    adb install -r c:\apps\com.xrath.jmsn-2.apk
    adb install -r c:\apps\com.xtralogic.android.rdpclient-1.apk
    adb install -r c:\apps\com.xtremelabs.android.speedtest-1.apk
    adb install -r c:\apps\com.yahoo.mobile.client.android.im-1.apk
    adb install -r c:\apps\com.yahoo.mobile.client.android.mail-2.apk
    adb install -r c:\apps\com.yahoo.mobile.client.android.search-1.apk
    adb install -r c:\apps\hongbo.bluescreen-1.apk
    adb install -r c:\apps\info.marlan.sim-1.apk
    adb install -r c:\apps\koushikdutta.telnet-1.apk
    adb install -r c:\apps\kr.mobilesoft.yxplayer-2.apk
    adb install -r c:\apps\net.mafro.android.wakeonlan-1.apk
    adb install -r c:\apps\nl.rogro.GScript-1.apk
    adb install -r c:\apps\org.ajeje.fakelocation-1.apk
    adb install -r c:\apps\org.ale.abtc-1.apk
    adb install -r c:\apps\org.android7.aviplayer-1.apk
    adb install -r c:\apps\org.connectbot-1.apk
    adb install -r c:\apps\org.gmote.client.android-1.apk
    adb install -r c:\apps\org.iii.ro.meridian-1.apk
    adb install -r c:\apps\org.kman.WifiManager-1.apk
    adb install -r c:\apps\org.openobjectives.serverassistant-1.apk
    adb install -r c:\apps\org.prowl.networkmapper-1.apk
    adb install -r c:\apps\org.transdroid-1.apk

    This will go in sequence and show "success" when finished installing. It will then run the next command in sequence until its done.

    ** I tried to write this thread as a help to those trying to do the same thing I was trying to do. This is in no way meant to validate anything and is meant merely as a resource to anybody. If your going to be an ass, shove it, if you like it, im happy I could help.**
    2
    this is simplest method yet...

    copy .apk to any folder in sdcard, mine "marketapp"
    then type these following commands below:

    =====================================
    adb shell
    su
    cd /sdcard/marketapp
    for app in *.apk; do pm install -r $app; done
    =====================================

    regards,
    d4rkcell
    1
    Even easier.

    Thanks for the great information. I realize you can save yourself a few steps after gathering all the apk's in one location by using this command line (XP or higher):

    Step 2. In the Android SDK folder containing adb, type:
    Code:
    for %f in (c:\apps\*.apk) do @(echo adb install -r %f)

    I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.

    My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!

    So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.

    To do this its simple, just write your own batch script and run adb install.

    You will need:

    1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
    Code:
    youtube.com/watch?v=A1SOSXwkc_8
    2. USB Cable to PC
    3. Enable "USB Debugging" on phone
    **Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**

    Now, I assume you already have the APK bunch on your SD card, like I had.

    I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).

    Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.

    Step 1.
    Open command prompt (CMD) and change directory to your "c:\apps"
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone