A small multiplatform command-line tool that installs .apks split-APK bundles (as produced by bundletool) onto an Android device over ADB. Each APK is streamed straight from the archive, with nothing extracted to disk.
Trivial flow:
- Opens the
.apksfile (a ZIP) with miniz and collects every embedded.apkentry and its uncompressed size. - Connects to the local ADB server on
127.0.0.1:5037. If nothing is listening, it runsadb start-server(bundled copy first, thenPATH) and retries once. - Selects the device with
host:transport-any, orhost:transport:<serial>if a serial is given. - Runs the package manager session flow over
exec:services:
cmd package install-create -r -S <total_bytes>
cmd package install-write -S <apk_bytes> <session> <index>_<name>.apk -
cmd package install-commit <session>
- A C99 compiler with GNU extensions (
gccorclang); MinGW-w64 on Windows - adb from platform-tools, on
PATHor inplatform-tools/next to the executable - An Android device with USB debugging enabled
With make:
make
Without make:
# Windows
gcc -std=gnu99 -O2 -w -c miniz/miniz.c -o miniz/miniz.o
gcc -std=gnu99 -O2 -Wall -Wextra -isystem miniz src/main.c src/apks.c src/install.c src/adb_win.c src/adb_posix.c miniz/miniz.o -o apks_installer.exe -lws2_32
# Linux / macOS
gcc -std=gnu99 -O2 -w -c miniz/miniz.c -o miniz/miniz.o
gcc -std=gnu99 -O2 -Wall -Wextra -isystem miniz src/main.c src/apks.c src/install.c src/adb_win.c src/adb_posix.c miniz/miniz.o -o apks_installer
apks_installer <file.apks> [device_serial]
With one connected device the serial can be omitted. With several, pass the serial as listed by adb devices.
apks_installer app.apks
apks_installer app.apks R58M123ABC
Apache 2.0. See the LICENSE file.