A Node.js API wrapper for ADB (Android Debug Bridge)
- 🔍 List connected devices
- 📱 Manage Android apps (launch, kill, clear data)
- 📦 Download APKs from devices
- 🔎 Fuzzy search packages
- ⚡ Fast and reliable
npm install node-adb-api
const adb = require('node-adb-api');
// Get list of connected device serial numbers
const devices = adb.getListOfDevices();
// Check if a device is connected
const isConnected = adb.isAnyDeviceConnected('device_serial');
// Get list of installed packages on a device
const packages = adb.getPackagesByDeviceSerialNumber('device_serial');
// Fuzzy search packages
const results = await adb.fuzzySearchPackages(null, 'chrome');
// Get APK path on device
const path = adb.getDeviceApkPath('device_serial', 'com.example.app');
// Download APK from device
const apkFile = adb.downloadAPK('device_serial', 'com.example.app');
// Launch an app
adb.launchApp('com.example.app', 'device_serial');
// Force kill an app
adb.forceKill('com.example.app', 'device_serial');
// Clear app data
adb.clearData('com.example.app', 'device_serial');
// Uninstall an app
adb.uninstall('com.example.app', 'device_serial');
Returns an array of connected device serial numbers.
Checks if the specified device is connected.
-
deviceSerialNumber
: Device serial number to check
Returns an array of package names installed on the device.
-
deviceSerialNumber
: Target device serial number
Performs a fuzzy search on installed packages.
-
packages
: Optional array of packages to search in -
textToFind
: Search query string
Gets the path of an APK file on the device.
-
deviceSerialNumber
: Target device serial number -
chosenPackage
: Package name to locate
Downloads an APK file from the device.
-
deviceSerialNumber
: Target device serial number -
chosenPackage
: Package name to download - Returns: The downloaded APK filename
Launches an app on the device.
-
chosenPackage
: Package name to launch -
selectedDevice
: Target device serial number
Force stops an app on the device.
-
chosenPackage
: Package name to force stop -
deviceSerialNumber
: Target device serial number
Clears app data on the device.
-
chosenPackage
: Package name to clear data -
deviceSerialNumber
: Target device serial number
Uninstalls an app from the device.
-
chosenPackage
: Package name to uninstall -
selectedDevice
: Target device serial number
# Install dependencies
npm install
# Run tests
npm test
# Run linting
npm run lint
purrge - 🐱 Quickly purrge android apps from your phone
MIT © Cesar Ferreira