LinuxCommandLibrary

adb

Android Debug Bridge client-server tool

TLDR

List connected devices

$ adb devices
copy
Install an APK
$ adb install [app.apk]
copy
Copy file from device to computer
$ adb pull [/sdcard/file.txt] [./local/]
copy
Copy file from computer to device
$ adb push [local_file] [/sdcard/]
copy
Open a shell on the device
$ adb shell
copy

SYNOPSIS

adb [-d|-e|-s serial] command [options]

DESCRIPTION

adb (Android Debug Bridge) is a versatile command-line tool for communicating with Android devices. It provides access to a Unix shell for running commands, installing/uninstalling apps, transferring files, and debugging applications.
The tool operates through a client-server architecture where the adb server runs on your computer and communicates with the adb daemon (adbd) on connected devices. Connections can be made via USB or wirelessly over TCP/IP.

PARAMETERS

-d

Direct command to the only connected USB device
-e
Direct command to the only running emulator
-s serial
Direct command to device with specified serial number
devices
List all connected devices and their states
install apk
Install an APK file
uninstall package
Remove an application by package name
push local remote
Copy file from computer to device
pull remote local
Copy file from device to computer
shell
Open interactive shell or run command on device
logcat
View device log output
forward local remote
Set up port forwarding
reverse remote local
Set up reverse port forwarding
reboot
Reboot the device (bootloader, recovery options available)
start-server
Start the adb server
kill-server
Stop the adb server

CONFIGURATION

~/.android/adb_usb.ini

List of USB vendor IDs for device detection, one per line.
~/.android/adbkey
RSA private key used for device authentication. The corresponding public key (adbkey.pub) is pushed to authorized devices.
ANDROID_ADB_SERVER_PORT
Environment variable to override the default adb server port (5037).
ADB_VENDOR_KEYS
Environment variable specifying colon-separated paths to additional RSA key files for device authorization.

CAVEATS

USB debugging must be enabled on the device. First connection requires authorizing the computer on the device. Some commands require root access. Wireless debugging requires initial USB setup or pairing (Android 11+).

HISTORY

adb was developed by Google as part of the Android SDK, first released with Android 1.0 in 2008. It has evolved to support features like wireless debugging, scoped storage access, and improved security through RSA key authentication.

SEE ALSO

fastboot(1), aapt(1), logcat(1)

> TERMINAL_GEAR

Curated for the Linux community

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50