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 intextToFind
: Search query string
Gets the path of an APK file on the device.
deviceSerialNumber
: Target device serial numberchosenPackage
: Package name to locate
Downloads an APK file from the device.
deviceSerialNumber
: Target device serial numberchosenPackage
: Package name to download- Returns: The downloaded APK filename
Launches an app on the device.
chosenPackage
: Package name to launchselectedDevice
: Target device serial number
Force stops an app on the device.
chosenPackage
: Package name to force stopdeviceSerialNumber
: Target device serial number
Clears app data on the device.
chosenPackage
: Package name to clear datadeviceSerialNumber
: Target device serial number
Uninstalls an app from the device.
chosenPackage
: Package name to uninstallselectedDevice
: 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