I want to batch install apks from my desktop directly. Such as I downloaded many apks on the desktop and want to install apks without actually touching my android.
How to do this?
I want to batch install apks from my desktop directly. Such as I downloaded many apks on the desktop and want to install apks without actually touching my android.
How to do this?
That's done easiest using adb (see the ADB tag-wiki for details on what ADB is and how to get/install it on your machine). As you don't state the OS you're using on your desktop, I write how it could be done on Linux (which I work with); should be easily adaptable to other platforms:
.apk
files into a single folderadb devices
should list a connected device).apk
files residefor file in *.apk; do adb install $file; done
NOTE: If you have .apk
files which have "spaces" in their names such as 'Xposed Framework', 'Adobe Flash Player' etc. then you will have to rename them, as ADB cannot handle that. Either remove the spaces altogether, or replace them e.g. by underscores. Linux provides a Perl script for that (/usr/bin/rename
) which you can use:
rename 's/ /_/g' *.apk
It replaces all space
character with _
, which makes names like this Xposed_Framework
, Adobe_Flash_Player
which are recognizable by adb.
If you have apks in different folders (like if you used adb pull
) then you can use my script below:
for /r %f in (*.apk) do adb install -r "%f"
Just run it in the folder above all your APK Files and it will recurse and install all of them.
For windows, open command line:
set PATH=%PATH%;C:\path_to_your_platform-tools\
then
for %e in (*.apk) do adb install %e
So you have a problem that you have tons of apps to install and you didn't do a backup like Titanium Backup or other backup-restore app. But one-by-one installing and confirming and waiting would take forever, not to mind it's so tedious!
I tried to find an app that could do it to save me the effort, but after trying them all, none of them worked. So I was doing it one-by one and it was taking so long that I decided to just do it with ADB.
No worries, I am here to save you, if you are using Windows. You can solve this using ADB. You might not know how to use ADB so I will write the full instructions here. Don't worry, it's easy.
How to do it in Windows:
On your phone,
Settings > Developer Options
(Click on Settings > About Phone > Software > Build Number
7 times to activate Developer mode)USB Debugging
Verify apps over USB
Now you are ready for the next step.
On your Windows computer:
platform-tools
folder into your computer. I recommend the root of your C:
drive, so that it is located at C:\platform-tools\
C:\platform-tools\apks\
Now, your phone is connected and you have ADB installed on your computer, so you are ready to enter the following into your command line.
First, test to see if your device is connected.
cd C:\platform-tools\
adb devices
If your phone is properly connected, you will see something like this:
* daemon not running: starting now at tcp:5037
* daemon started successfully
List of devices attached
Z1Z1Z1Z1Z1Z1 device
where Z1Z1Z1Z1Z1Z1
is the device ID of your phone.
If you saw that, you are successful. Proceed to do the install commend:
for %e in (apks\*.apk) do adb install %e
If it worked, success! Enjoy watching everything get installed quick. It's probably faster to do this than to manually install 300+ apks on your phone.
ISSUES AND SOLUTIONS
If you get the error more than one installed
and you saw emulator-5556
under your device, try this (or you can skip to the end and see the way to get around this problem):
adb kill server
in the CMD windowadb devices
adb kill server
in the CMD window (don't check adb devices again)Then run the final command and watch everything get installed.
All apps might not install because your computer is too fast for the command prompt and some might say "more than one device/emulator", while others install normally. In this case, I have a solution.
adb devices
. Take note of your device ID like the Z1Z1Z1Z1Z1Z1
in the output above.-s
. See an example command below:
for %e in (apks\*.apk) do adb -s Z1Z1Z1Z1Z1Z1 install %e
where Z1Z1Z1Z1Z1Z1
is the device ID of your phone.
This is going to make sure that ADB ignores any other devices and it will prevent the "multiple devices" error.
Hope it helps!
In addition to adb install
, you can directly use package manager
from adb shell
to install apps. Place .apk
files in /data/local/tmp
and make sure files are readable, SELinux context must be u:object_r:shell_data_file:s0
. Now:
~$ cd /data/local/tmp
~$ ls *.apk | xargs -I {} pm install '{}'
Another simple root solution - though not from computer - is to use some file explorer e.g. MiXplorer to batch install apps. Select all .apk
files and tap on Install
from menu.
For Linux, in the directory that APK is located, open terminal and type
find . -name "*.apk" -exec adb install {} \;
For Windows:
Using ADB (Android SDK Installed & PATH set correctly) and Command Prompt on Windows
Run the following to make sure ADB is working
adb devices
Place all APKs in a folder
cd C:\your\path\to\folder\of\apks
for %e in (*.apk) do adb install "%e"
Improved version based on @thetechreader's answer (works for file names with space/symbols)
I just ran into the same situation. Am writing this soln which is enhancement from the ones given for two reasons
--You have a LOT of apps to install most likely your previous backup . Cant afford to keep phone connected . If your adb
snaps you should know what you already installed and not waste time, going over everything again
--If some apps erred - need to know which ones and avoid them
I did this with adb shell
but you can do it from outside much the same. My Apps were lying in my memory card partition
.
for apk in `find . -iname *apk -type f` ; do pm install $apk
( test $? -ne 0 && mv $apk $apk.ni ) || mv $apk $apk.ok ; done
sample output of bad installs
# find . -iname *.ni -type f
./org.satok.gweather-bSyZZ3_Zu8ElvJR_4l5sJg==/base.apk.ni
./com.teslacoilsw.launcher-AAZW9c2u4qCjIL3ZmVKsQg==/base.apk.ni
./com.linkedin.android-hLWhs0ddIZ2KWTRO-bZG_Q==/base.apk.ni
./com.google.android.apps.youtube.music-arEVgcC5NTbNUAwP-oYz6A==/base.apk.ni
./com.udemy.android--4YWw0rFLDSA-koaYxCsRA==/base.apk.ni
./com.theporter.android.customerapp-rKFfqbF4WgXvCouQ4ZcvUQ==/base.apk.ni
./com.vested.investing.android-tx7OKTeaemkmdOnomJqTGg==/base.apk.ni
./com.inscripts.namaste-TnRILvo6qbtjjen2r-BTSw==/base.apk.ni
./com.google.android.soundpicker-13nSUeHMYf5qIkXTC1I56Q==/base.apk.ni
and good installs
find . -iname *.ok -type f
./org.videolan.vlc-UMth4_20QtXe66eAx1qzRw==/base.apk.ok
./com.zoho.meeting-0fFi8KgjQBd2N0OZcwdyqA==/base.apk.ok
./sulekha.yellowpages.lcf-JGBM0zpT3hVj2XShwoKvRw==/base.apk.ok
./com.teradata.tcapp-BjVV7TLB5aBUfbW32KzN2A==/base.apk.ok
./com.oasisfeng.greenify-_OK3qGqs7MsTO-QY5aKOeQ==/base.apk.ok
You can install APK directly from your computer to Android mobile through ADB. First, download ADB and install it. You can download it from Google's DL Repository if you did not have it already.
Then enable developer mode on your mobile. You can find it in the settings of your mobile.
And then run this command.
adb install "path to your apk file"
For example:
C:\Users\Owner>adb install C:\Users\Owner\Downloads\android-agent.apk