
Android Debug Bridge (adb) is a command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device. It is a client-server program that includes three components:
- A client, which sends commands. The client runs on your development machine. You can invoke a client from a command-line terminal by issuing an adb command.
- A daemon (adbd), which runs commands on a device. The daemon runs as a background process on each device.
- A server, which manages communication between the client and the daemon. The server runs as a background process on your development machine.
The following tables are the most commands that we are using with Android Devices :
Device Basics
adb devices | Lists connected devices |
adb devices -l | Lists connected devices and kind |
adb root | Restarts adbd with root permissions |
adb start-server | Starts the adb server |
adb kill-server | Kills the adb server |
adb remount | Remounts file system with read/write access |
adb reboot | Reboots the device |
adb reboot bootloader | Reboots the device into fastboot |
Remote Shell
adb shell <command> | Runs the specified command on device (most unix commands work here) |
adb shell wm size | Displays the current screen resolution |
adb shell wm size WxH | Sets the resolution to WxH |
adb shell pm list packages | Lists all installed packages |
adb shell pm list packages -3 | Lists all installed 3rd-party packages |
adb shell monkey -p app.package.name | Starts the specified package |
File Management
adb push <local> <remote> | Copies the local to the device at remote |
adb pull <remote> <local> | Copies the remote from the device to local |
Good luck!