ADB (Android Debug Bridge) Commands¶
Discover a comprehensive collection of ADB commands for Android debugging and development. Learn how to manage variables, execute general commands, control network settings, and utilize miscellaneous functions with ADB.
Variables¶
Variable | Description |
---|---|
$ADB_TRACE |
Comma-separated list of debug info to log |
$ADB_VENDOR_KEYS |
Colon-separated list of keys (files or directories) |
$ANDROID_SERIAL |
Serial number to connect to (see -s ) |
$ANDROID_LOG_TAGS |
Tags to be used by logcat (see logcat --help for more) |
$ADB_LOCAL_TRANSPORT_MAX_PORT |
Max emulator scan port (default 5585, 16 emus) |
$ADB_MDNS_AUTO_CONNECT |
Comma-separated list of mdns services to allow auto-connect |
General Commands¶
Create bugreport.zip
in /sdcard
path¶
List pids of processes hosting a JDWP transport¶
Show device log¶
Sideload the given full OTA
package¶
Restart adbd with root permissions¶
Restart adbd without root permissions¶
Restart adbd listening on USB¶
Restart adbd listening on TCP on PORT¶
Restart userspace¶
Start adb server¶
Kill adb server¶
Stop adb server¶
Kick connection from host side to force reconnect¶
Kick connection from device side to force reconnect¶
Reset offline/unauthorized devices to force reconnect¶
Attach a detached USB device¶
Detach from a USB device to allow use by other¶
Enter device shell
¶
Choose escape character, or "none"
; default '~
'¶
Don't read from stdin
¶
Disable pty allocation¶
Allocate a pty
if on a tty
¶
Force allocate a pty
if on a tty
¶
Disable remote exit codes and stdout/stderr
separation¶
Run emulator
console command¶
Enter device shell when there is more than one device connected¶
Enter the device shell when there is more than one device connected.
- USB connected:
- Network connected:
Print connection status¶
Print current adb version installed¶
Network Commands¶
Connect to a device via TCP/IP¶
- Default port: 5555
Disconnect all connected devices¶
Disconnect from the given TCP/IP device¶
Pair with a device for secure TCP/IP communication¶
List all forward socket connections¶
Forward socket connection¶
- Port 0 = Any port