Skip to main content

Overview

The CLI version (apk-downloader.bat) provides a full-featured command-line interface with interactive menus, color-coded output, and all the capabilities of the web interface.
The CLI doesn’t require Node.js - it’s a standalone Windows batch script that uses ADB directly.

Launching the CLI

Double-click apk-downloader.bat or run it from Command Prompt:
cd C:\path\to\apk-extractor
apk-downloader.bat
The CLI will:
  1. Check for ADB installation
  2. Show the main menu
  3. Wait for your input
The main menu provides access to all features:
  ╔══════════════════════════════════════════════════════╗
  ║            APK EXTRACTOR  |  Menu Principal        ║
  ╚══════════════════════════════════════════════════════╝

  ADB: C:\platform-tools\adb.exe

  [1] Listar dispositivos conectados
  [2] Depuracion inalambrica (WiFi)
  [3] Dispositivos guardados
  [4] Cambiar ruta de ADB
  [5] Salir

  Elige una opcion [1-5]:
Lists all connected devices (USB and WiFi) with brand/model information.

Color-Coded Output

The CLI uses ANSI escape codes for better readability:

Cyan

Headers and section titles

Green

Success messages and confirmations

Yellow

Menu options and prompts

Red

Errors and critical warnings

Gray

Secondary information

Magenta

Important highlights
Example:
echo  %C_GREEN%[OK]%C_RESET% ADB encontrado en el sistema
echo  %C_RED%[!]%C_RESET% Error al conectar
echo  %C_YELLOW%[1]%C_RESET% Listar dispositivos

Working with Devices

Listing Devices

Select option [1] from the main menu:
1

Detection

The CLI runs adb devices to find all connected devices:
"%ADB_EXE%" devices 2>nul > "%TMP_DEVLIST%"
2

Device List

You’ll see all devices with custom names (if set):
Dispositivos encontrados: 2

[1] My Pixel 6  (1A2B3C4D5E6F7G8H)
[2] 192.168.1.100:5555

[0] Volver al menu principal

Selecciona un dispositivo [0-2]:
3

Device Menu

After selecting a device, you’ll see its information:
Nombre   : My Pixel 6
Serial   : 1A2B3C4D5E6F7G8H
Marca    : Google
Modelo   : Pixel 6
Android  : 13  (API 33)

[1] Listar aplicaciones instaladas
[2] Asignar nombre al dispositivo
[3] Volver a la lista de dispositivos
[4] Volver al menu principal

Custom Device Names

To set a custom name for easier identification:
  1. Select [2] Asignar nombre al dispositivo from the device menu
  2. Enter a descriptive name (or leave empty to remove)
  3. The name is saved to device-names.json
Nombre actual: My Pixel 6
Ingresa el nuevo nombre (dejar vacio para eliminar):

Nombre: QA Test Device

[OK] Dispositivo renombrado a: QA Test Device
Device names are shared between the web interface and CLI - set a name in one, see it in both!

Listing Applications

From the device menu, select [1] Listar aplicaciones instaladas:
1

Choose filter

Select which apps to list:
¿Qué aplicaciones deseas listar?

[1] Solo aplicaciones de terceros (instaladas por el usuario)
[2] Todas las aplicaciones (incluye sistema)
[0] Volver
2

Loading

The CLI fetches the app list and calculates sizes:
Cargando lista (esto puede tardar unos segundos)...
Detectando formato y tamaño de cada app...
(Las apps del sistema pueden tardar mas)
Size calculation uses du -b on the device for exact byte counts:
"%ADB_EXE%" -s "%SERIAL%" shell du -b "%PATH%"
3

Paginated list

Apps are displayed 15 per page:
Num  Paquete                              Formato     Tamaño
───  ────────────────────────────────────  ──────────  ──────

[1]  com.android.chrome                  APK         89 MB
[2]  com.whatsapp                         Split APK   67 MB
[3]  com.spotify.music                    Split APK   102 MB
...

Pagina 1 de 8

Ingresa el numero de la app para ver detalles.
[A] Pagina anterior
[S] Pagina siguiente
[0] Volver
Use [A] (anterior) and [S] (siguiente) to navigate pages quickly.

Extracting APKs

After selecting an app from the list:

Single APK

For regular APK files:
1

App details

Dispositivo : Google Pixel 6
Paquete     : com.android.chrome
Version     : 108.0.5359.128  (Code: 535912800)
Archivos APK: 1

Ruta en dispositivo:
  /data/app/~~xyz==/com.android.chrome-abc123==/base.apk

[1] Extraer APK a esta PC
[0] Volver a la lista de aplicaciones
2

Choose destination

Carpeta de destino (Enter para usar el escritorio):
> C:\Users\YourName\Documents\APKs
3

Extraction

The CLI uses adb pull to download the APK:
"%ADB_EXE%" -s "%SERIAL%" pull "%DEVICE_PATH%" "%LOCAL_PATH%"
Output:
Extrayendo APK...
Destino: C:\Users\YourName\Documents\APKs\com.android.chrome.apk

/data/app/.../base.apk: 1 file pulled, 0 skipped. 89.3 MB/s (93456789 bytes in 1.001s)

╔══════════════════════════════════════════════════════╗
║  [OK] APK extraido exitosamente!                    ║
╚══════════════════════════════════════════════════════╝

Archivo guardado en:
  C:\Users\YourName\Documents\APKs\com.android.chrome.apk
The destination folder opens automatically in Windows Explorer.

Split APK (XAPK)

For apps with multiple APK files:
1

Split APK detected

Archivos APK: 5

┌──────────────────────────────────────────────────────┐
│  [!]  SPLIT APK / XAPK detectado                    │
│                                                      │
│  Esta app contiene 5 archivos APK separados.        │
│  Los archivos son:                                   │
└──────────────────────────────────────────────────────┘

  - base.apk
  - split_config.arm64_v8a.apk
  - split_config.en.apk
  - split_config.xxhdpi.apk
  - split_config.xxxhdpi.apk

[1] Compilar los 5 APKs en un archivo XAPK
[0] Volver a la lista
2

Compilation process

Select [1] to start XAPK compilation:
Paso 1/3: Extrayendo APKs del dispositivo...

  Extrayendo: base.apk
  [OK] base.apk
  Extrayendo: split_config.arm64_v8a.apk
  [OK] split_config.arm64_v8a.apk
  ...

Paso 2/3: Creando manifest.json...
  [OK] manifest.json creado

Paso 3/3: Empaquetando en XAPK...
3

Success

╔══════════════════════════════════════════════════════╗
║  [OK] XAPK compilado exitosamente!                  ║
╚══════════════════════════════════════════════════════╝

Archivo: C:\Users\YourName\Desktop\com.whatsapp.xapk

Puedes instalar el .xapk con:
  - XAPK Installer (APKPure)
  - APKMirror Installer
  - Mediante SAI (Split APKs Installer)
XAPK files are ZIP archives containing all APK splits plus a manifest.json that describes the package structure.

Wireless Debugging

Select option [2] from the main menu to pair a device wirelessly:
1

Enable wireless debugging

On your Android device (Android 11+):
  1. Go to SettingsDeveloper Options
  2. Enable Wireless debugging
  3. Tap Pair device with pairing code
2

Pairing

Enter the connection details from your device:
┌─────────────────────────────────────────────────────┐
│  Paso 1: Emparejamiento                             │
└─────────────────────────────────────────────────────┘

IP del dispositivo: 192.168.1.100
Puerto de vinculacion: 37891
Codigo de vinculacion (6 digitos): 123456

Emparejando con 192.168.1.100:37891...

Successfully paired to 192.168.1.100:37891

[OK] Emparejamiento exitoso.
3

Connection

Get the connection port from Wireless debugging screen:
┌─────────────────────────────────────────────────────┐
│  Paso 2: Conexion                                   │
└─────────────────────────────────────────────────────┘

Puerto de conexion: 33445

Conectando a 192.168.1.100:33445...

connected to 192.168.1.100:33445

[OK] Conectado exitosamente a 192.168.1.100:33445

[OK] Dispositivo guardado para reconexion futura.
The device is automatically saved to devices.json for quick reconnection.

Saved Devices

Manage your saved WiFi devices with option [3] from the main menu:
  ╔══════════════════════════════════════════════════════╗
  ║            APK EXTRACTOR  |  Dispositivos Guardados║
  ╚══════════════════════════════════════════════════════╝

  Dispositivos guardados: 2

  [1] Google Pixel 6  (192.168.1.100:33445)
  [2] Samsung Galaxy S21  (192.168.1.101:39021)

  [C] Conectar a un dispositivo
  [D] Eliminar un dispositivo
  [0] Volver al menu principal
Select [C], then enter the device number:
Numero del dispositivo a conectar [1-2]: 1

Conectando a 192.168.1.100:33445...
connected to 192.168.1.100:33445
[OK] Conectado a Google Pixel 6
If the port has expired:
[!] No se pudo conectar. Los puertos pueden haber caducado.

¿Deseas re-vincular este dispositivo? [S/N]: S

IP: 192.168.1.100 (no modificable)
Nuevo puerto de vinculacion: 41234
Codigo de vinculacion: 654321

Emparejando...
Successfully paired to 192.168.1.100:41234

Nuevo puerto de conexion: 35678

Conectando a 192.168.1.100:35678...
[OK] Puertos actualizados.

ADB Configuration

Select option [4] to reconfigure ADB:

Automatic Download

¿Qué deseas hacer?

[1] Ingresar la ruta donde tengo ADB instalado
[2] Descargar ADB ahora (se instalara en C:\platform-tools)
[3] Volver al menu principal

Elige una opcion [1-3]: 2

Descargando Android Platform Tools desde Google...
URL: https://dl.google.com/android/repository/platform-tools-latest-windows.zip

Extrayendo archivos en C:\...

[OK] ADB instalado en C:\platform-tools
[OK] Ruta guardada en configuracion.

Manual Path

Elige una opcion [1-3]: 1

Ingresa la ruta completa a adb.exe
Ejemplo: C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe

Ruta: C:\Android\platform-tools\adb.exe

[OK] Ruta guardada correctamente.
The path is saved to config.txt and used for all future sessions.

Troubleshooting

Your terminal may not support ANSI escape codes. Try:
  • Windows Terminal (recommended)
  • Windows 10/11 Command Prompt (colors work by default)
  • Avoid old Windows 7 cmd.exe
ADB is not installed or not in PATH. Use option [4] from the main menu to configure ADB.
The Android device hasn’t authorized your PC. Check the device screen for the authorization prompt and tap Allow.
Multiple devices are connected. The CLI should prompt you to select one - if not, disconnect other devices or use the -s flag manually.
WiFi debugging ports change when the device restarts or toggles the wireless debugging feature. Save the device and use [C] to reconnect - it handles re-pairing automatically.

Next Steps

Device Management

Learn advanced device management techniques

Extracting APKs

Detailed guide on APK extraction

Wireless Debugging

Complete wireless debugging setup

Saved Devices

Configuration file formats

Build docs developers (and LLMs) love