Last updated: Sep 12, 2025
Android Debug Bridge Shortcuts That Save Minutes Daily in Android Studio
Android Debug Bridge Shortcuts (ADB) are the fastest way to cut wasted minutes in Android Studio. Instead of clicking through menus, developers can rely on these ADB productivity tips to install apps, capture logs, transfer files, or reboot devices in seconds.
Every Android developer should master at least ten Android Debug Bridge time savers, they pay off daily and streamline your workflow.
This guide answers common “How do I…?” questions with real terminal outputs, reusable scripts, and shortcuts. Use these tested ADB tricks to speed up installs, logging, cache clears, and multi-device debugging.
How do I install an APK on a connected device or emulator using Android Debug Dridge (ADB)?

Use adb install
with the path to your APK. For example:
$ adb install app-debug.apk
This copies the APK to the device and installs it. By default, it installs fresh; to update an existing app (without losing data), add
(reinstall). In a multi-device setup, specify the target:-r

# List devices/serials $ adb devices List of devices attached emulator-5554 device emulator-5556 device # Install on emulator-5556 $ adb -s emulator-5556 install app-debug.apk
The -s
flag directs the command to a specific serial number. (You can also use -d
to target only a USB device or -e
for only an emulator when one device is connected.) Android Studio typically handles installs during development, but knowing
is useful for quick manual installs or testing outside the IDE.adb install
How can I specify a particular device or emulator for adb commands?
First, list attached devices with adb devices -l
. This shows each device’s serial, state, and model. For example:
$ adb devices -l List of devices attached emulator-5556 device product:sdk_phone_x86_64 model:Android_SDK_built_for_x86_64 1234ABCD device model:Pixel_5 device:redfin
To run a command on one device, use its serial via
:-s
$ adb -s 1234ABCD install app.apk
If multiple devices/emulators are connected, using -d
tells ADB to target the only USB-connected device, and -e
targets the only emulator. If you’ll run many commands on the same device, you can also set the
environment variable to that serial.ANDROID_SERIAL
These options let you quickly switch targets without re-plugging devices. (The official docs note that
lists serials and states for each device.) If you forget to specify a target and multiple devices are connected, ADB shows an error like “more than one device” and offers these adb devices -l
flags as the solution.-s/-d/-e
How do I clear an app’s cache or data using ADB?

To reset an app’s data (including cache), use the package manager’s
command via clear
. For example:adb shell
$ adb shell pm clear com.example.myapp
This deletes all data for the given package. In practice, you often use it after testing to start the app fresh without reinstalling. (Note: this deletes app data and cache. Android’s package manager doesn’t have a built-in “cache only” flag via ADB; clearing cache usually requires root or manual steps. The general clear
clears everything.) You can also combine commands: e.g.
$ adb shell pm uninstall --user 0 com.example.myapp # uninstall for current user $ adb shell pm clear com.example.myapp # clear data (cache+db)
Another trick: if you’re testing and just want to reinstall without losing data, use
(reinstall) instead of uninstalling. In summary, adb install -r
is the fastest way to wipe an app’s data/cache.adb shell pm clear
How can I capture or save device logs efficiently with ADB?

ADB’s built-in logcat tool dumps system logs (including app
messages) to the terminal. A simple shortcut:Log.d/e
$ adb logcat
This streams live logs. To filter by tag or priority, use expressions (for example
to see only Debug+ logs from “MyAppTag” and silence others). To save logs to a file for analysis, use adb logcat MyAppTag:D *:S
(dump) with output redirection:-d
$ adb logcat -d > myapp_log.txt
This dumps the entire log buffer since the last reboot into
on your computer. (You can clear logs first with myapp_log.txt
if you want only recent entries.)adb logcat -c
For example, running:
$ adb logcat -d | grep "MyAppTag"
will dump logs and filter for your app’s tag. Another useful command is
, which captures full system state and logs (useful for bug triage). In Android Studio, you normally use the Logcat window, but command-line logcat is great when working in scripts or remote shell. (See Our Guide on Flutter Plugin Development for Android Studio).adb bugreport > report.zip
How do I transfer files between my computer and the device/emulator?

Use
and adb push
. These copy files between host and device. For example:adb pull
# Push a file from PC to device $ adb push localfile.txt /sdcard/Download/ # Pull a file from device to PC $ adb pull /sdcard/Download/data.db ~/Desktop/
This will copy
into the device’s Download folder, and pull localfile.txt
out to the desktop. As the official docs note, data.db
and adb push [source] [dest]
work like you’d expect. You can also push whole directories with the same commands. This is faster than opening file explorers, and can be scripted easily. For example, adb pull [remote] [local]
grabs all photos from the device. The gist cheat sheet confirms these commands: adb pull /sdcard/DCIM ./photos
and adb push [source] [destination]
.adb pull [device_location] [local_location]
What reboot commands are useful in ADB?

ADB can reboot the device or reboot into bootloader/recovery. Key commands include:
– Restarts the device normally.adb reboot
– Reboots into the Recovery menu (without holding buttons).adb reboot recovery
– Restarts into the bootloader (fastboot).adb reboot-bootloader
For example:
$ adb reboot
will reboot the attached device immediately. These shortcuts save time versus manually long-pressing power/volume. Also, if you make a change (like an unlocked bootloader) and need root ADB temporarily,
restarts adbd with root permissions (on emulators or rooted devices only). After using adb root and testing, use adb root
to go back. Knowing adb unroot
reboot
options cuts minutes from testing workflows.
You can open an interactive shell on the device with:
$ adb shell
Once inside, you have a Linux-like terminal on the device. Some useful shell commands:
- Navigate file system:
,ls
cd
(e.g.
)adb shell ls /sdcard/Download
- Run Activity Manager commands: e.g.
to start an activity.adb shell am start -a android.intent.action.VIEW
- Generate UI input: e.g.
oradb shell input tap x y
.adb shell input text 'hello'
- Dump CPU/process info: e.g.
oradb shell dumpsys battery
.adb shell top
For example, to see running processes:
. Or to take a screenshot from the device:adb shell ps | grep myapp

$ adb shell screencap -p /sdcard/screen.png $ adb pull /sdcard/screen.png .
That lets you capture the device screen via ADB. Another trick: use
and adb tcpip 5555
to switch to Wi-Fi debugging (see HowTo below and Android Studio Debugging tips).adb connect <ip>:5555
Finally, you can chain commands on one line. For instance, on Linux/macOS:
$ adb devices | tail -n +2 | cut -f1 | xargs -I{} adb -s {} install -r myApp.apk
This installs an APK on all connected devices. Aliases and small scripts are great: e.g., in Bash you could add
to filter logs quickly. The GitHub repo “adb-shell-scripts” provides example scripts for common tasks.alias alog='adb logcat | grep'
Figure: Using
to connect a device (entering a wireless pairing code in terminal) (screenshot from Android docs)adb pair
Reusable ADB scripts and aliases
Automating repetitive ADB workflows saves time. For example, on macOS/Linux you might put this in
or ~/.bashrc
:~/.zshrc
alias adbl='adb devices -l' # list devices in detail alias adbreboot='adb reboot' # quick reboot alias adblog='adb logcat -d > log.txt' # save logs to file alias adbinstall='adb install -r' # install (replace existing, keep data)
And a short script (named apush
in PATH) could wrap pushing and installing:
#!/bin/bash # apush: push an APK and install it in one go APK_PATH="$1" adb push "$APK_PATH" /data/local/tmp/ adb shell pm install -r /data/local/tmp/$(basename "$APK_PATH")
The adb-shell-scripts repo collects useful functions; as its README notes, “shell scripts to make Android development a bit easier… wrappers around functionality ADB provides”. Experiment to create aliases for your most-used commands. Over time, these small shortcuts can save minutes each day.
Table: Common ADB Commands and Use Cases
Command | Description | Use Case Example |
---|---|---|
| Lists connected devices (serial numbers, state) | Check which devices/emulators are connected ( ). |
| Installs an APK on target device | Quickly deploy an app: . |
| Uninstalls an app from device | Remove test app:
|
| Clears all data (cache/db) for app | Reset app to initial state without uninstalling. |
| Dumps device log (use to output to file) | Capture logs: . |
| Copy file/dir from PC to device | Transfer file: . |
| Copy file/dir from device to PC | Retrieve file:
|
| Reboot device (normal) | Restart device after a change. |
| Reboot into bootloader/Fastboot | For unlocking bootloader or flashing. |
| Direct command to specific device | When multiple devices, e.g.
|
flags | for USB device, for emulator | Quickly target the USB phone vs emulator. |
How We Tested
We verified these tips on multiple OS environments: Windows 11 (Figure used from Windows), Ubuntu 22.04 (Linux), and macOS 13 (Ventura), all with Android SDK Platform-Tools v34+. Tests were conducted using a Samsung A15 (API 34). For each command above, we connected devices via USB (and tested the wireless pairing workflow) and confirmed the output. The table and scripts were validated on these setups.
FAQ
Q: What is adb devices
and why is it useful?
A: adb devices
lists all connected Android devices and emulators by serial number (with state). It’s often the first step to ensure your device is visible to ADB. If no devices appear, you may need to enable USB debugging on the device. A successful adb devices
response looks like:
$ adb devices List of devices attached emulator-5556 device 0123456789ABCDEF device
This confirms ADB can communicate with both the emulator and the physical device.
Q: How do I use -s
, -d
, or -e
with ADB?
A: When multiple devices are connected, ADB needs to know which one to target. Use
to specify a device by its serial number. Use -s <serial>
to target the only USB-connected device, or -d
to target the only emulator. For example, -e
installs the app on the specified emulator. Without these, ADB will error out if more than one device is attached.adb -s emulator-5556 install app.apk
Q: Can I update an installed app without losing its data?
A: Yes. Use
. The adb install -r MyApp.apk
flag reinstalls the app and keeps its data and cache. This is helpful to quickly deploy a new build without clearing settings. (If you want to fully reset the app, use -r
to wipe data.)adb shell pm clear <package>
Q: How can I quickly grab a screenshot or video of my device’s screen?
A: For screenshots, use
. For example:adb shell screencap
$ adb shell screencap -p /sdcard/screen.png $ adb pull /sdcard/screen.png .
For screen recording:
, then adb shell screenrecord /sdcard/demo.mp4
it. These avoid using the device UI and work well in automated tests. They are much faster than manually pressing buttons on the device.adb pull
Q: How do I clear only the cache of an app via ADB?
A: Android’s package manager does not provide a one-step “clear cache only” command for modern devices. The
command wipes all app data (which includes cache). To clear only the cache without data would require root or clearing the cache directory manually in a rooted shell. For most needs, adb shell pm clear <package>
is the fastest “reset” but remember it also deletes preferences and databases.pm clear
Q: How can I run multiple ADB commands more efficiently?
A: You can pipe and chain commands. For example, to install on every connected device:
adb devices | tail -n +2 | cut -f1 | xargs -I{} adb -s {} install -r myApp.apk
This pulls each device serial and applies the install. Also, using shell aliases (like
) or simple scripts (Bash, batch, etc.) for your common sequences will save keystrokes. The GitHub repo “adb-shell-scripts” has examples of such scripts for tasks like installing, logging, or listing activities.alias adbreboot='adb reboot'
Who should (and shouldn’t) use this
These ADB tips are aimed at Android developers who spend time on the command line and want to speed up their workflow. If you mostly use Android Studio’s graphical tools (e.g. the Run and Logcat windows), some shortcuts here may be less critical.
However, any developer who often needs to manually install APKs, grab logs, push files, or write automation scripts will benefit from these tricks. Testers and CI pipelines also use adb
extensively.
Conversely, if you only work on apps via the IDE without scripting or remote debugging, you may not use all these commands every day. In short, use these ADB productivity tips if you want faster CLI operations; skip advanced options if you’re a pure GUI user.