2 title: adb (Android Debug Bridge)
13 | Command | Description |
15 | `adb devices` | Lists connected devices |
16 | `adb devices -l` | Lists connected devices and kind |
18 | `adb root` | Restarts adbd with root permissions |
19 | `adb start-server` | Starts the adb server |
20 | `adb kill-server` | Kills the adb server |
21 | `adb remount` | Remounts file system with read/write access |
22 | `adb reboot` | Reboots the device |
23 | `adb reboot bootloader` | Reboots the device into fastboot |
24 | `adb disable-verity` | Reboots the device into fastboot |
26 `wait-for-device` can be specified after `adb` to ensure that the command will run once the device is connected.
28 `-s` can be used to send the commands to a specific device when multiple are connected.
33 $ adb wait-for-device devices
34 List of devices attached
35 somedevice-1234 device
36 someotherdevice-1234 device
40 $ adb -s somedevice-1234 root
45 | Command | Description |
47 | `adb logcat` | Starts printing log messages to stdout |
48 | `adb logcat -g` | Displays current log buffer sizes |
49 | `adb logcat -G <size>` | Sets the buffer size (K or M) |
50 | `adb logcat -c` | Clears the log buffers |
51 | `adb logcat *:V` | Enables ALL log messages (verbose) |
52 | `adb logcat -f <filename>` | Dumps to specified file |
57 $ adb logcat *:V > output.log
62 | Command | Description |
64 | `adb push <local> <remote>` | Copies the local to the device at remote |
65 | `adb pull <remote> <local>` | Copies the remote from the device to local |
70 $ echo "This is a test" > test.txt
71 $ adb push test.txt /sdcard/test.txt
72 $ adb pull /sdcard/test.txt pulledTest.txt
77 | Command | Description |
79 | `adb shell <command>` | Runs the specified command on device (most unix commands work here) |
80 | `adb shell wm size` | Displays the current screen resolution |
81 | `adb shell wm size WxH` | Sets the resolution to WxH |
82 | `adb shell pm list packages` | Lists all installed packages |
83 | `adb shell pm list packages -3` | Lists all installed 3rd-party packages |
84 | `adb shell monkey -p app.package.name` | Starts the specified package |