ADB Commands to Identify and Resolve Android Errors: Complete Guide

  • The ADB tool facilitates advanced communication between your computer and Android devices for diagnostics and troubleshooting.
  • There are key ADB commands for identifying, debugging, and repairing issues, as well as for flashing, installing, or removing apps without rooting your device.
  • Fastboot complements ADB by allowing firmware modifications and critical bug fixes, especially in recovery or bricking situations.

adb commands to troubleshoot Android

Have you ever encountered a problem on your Android phone that seems impossible to fix? Often, frustrating errors can be resolved thanks to the development tools Google provides. Among them, ADB (Android Debug Bridge) stands out as an essential utility for both developers and advanced users. This guide offers a comprehensive overview of how to identify and fix problems on your Android device using ADB and Fastboot commands , from the basics to advanced options like remote debugging or removing pre-installed apps without root access.

Understanding ADB not only opens the door to fixing problems , but also provides complete control over the operating system . From transferring files and installing applications to accessing hidden partitions or recovering your phone when it won't boot, let's review everything you need to know to get the most out of this essential tool.

What is ABS and what is it for?

ADB, the Android Debug Bridge, is a command-line tool that allows you to connect a computer to one or more Android devices to perform various actions . You can install, debug, and repair apps, access the operating system, move files, take screenshots, record the screen, and much more. Communication is done via USB or even Wi-Fi in recent versions, which facilitates wireless remote debugging.

ADB is a kind of "command bridge"It gives us the ability to interact directly with Android using commands we execute from our PC or Mac. Its basic function is to facilitate diagnostic and repair tasks., but it is also the key for developers and anyone who wants to have the maximum control over your mobile or tablet. Additionally, in some cases, it may be useful to know (https://www.todoandroid.es/how-to-solve-the-most-common-camera-failures-on-android-mobiles/).

adb command window

How ADB Works: Components and Requirements

ADB operates as a client-server system composed of three main elements :

  • Client: the terminal or command window on your PC from where commands are sent.
  • Daemon (adbd): process that runs on the Android device and actually executes the commands it receives.
  • employee: manages communication between your device and connected devices, running in the background on your computer.

By default, the server listens on TCP port 5037 and is responsible for locating all connected devices or emulators, whether via USB or Wi-Fi. From there, any ADB command can be sent to all detected devices from any client. You can even control everything from scripts if you're feeling extra advanced!

Important: All ADB clients use the same port, and if you're connecting more than one emulator, remember that each one uses a pair of consecutive ports. So, the emulator connected through port 5555 (for ADB) corresponds to the console of the same emulator on port 5554, and so on.

Getting Started: Enable USB Debugging and Connect the Device

To start using ADB you need to enable USB debugging on your Android device.

  1. Activate Developer Options: go to Settings> Phone information and press 7 times on Build Number until the developer menu is enabled.
  2. Access Developer Options and turns on the USB debugging.
  3. Connect your smartphone or tablet via USB cableWhen you do this, Android may ask you to authorize the computer with an RSA key for added security. Select "Always allow from this computer" if it's a trusted device.

In recent versions (Android 11 and later), you can also use ADB wirelessly as long as your PC and device are on the same Wi-Fi network, which makes troubleshooting much easier when USB is faulty or a cable is unavailable.

adb and fastboot commands for android

How to Install ADB and Fastboot on Windows, Linux, and Mac

ADB and Fastboot are usually installed along with Android Studio and the full SDK, but you can download them separately . You just need to copy the adb.exe and fastboot.exe files and their corresponding libraries (AdbWinUsbApi.dll and AdbWinApi.dll) to the same folder to run them from there, or place them in the system folder if you want them readily available.

On Windows, access the command prompt using CMD . On Mac and Linux, open a terminal. If you don't already have the universal ADB drivers, download and install them to ensure proper device detection.

Essential ADB Commands to Identify Faults

Let's get down to brass tacks: what are the essential commands for diagnosing, identifying, and solving problems in Android?

  • adb devices: Displays connected devices and their status. If your phone appears as "device" here, the connection is successful.
  • adb reboot: Reboot the device in normal mode.
  • adb reboot-bootloader: Reboots into bootloader mode, required for Fastboot commands.
  • adb reboot recovery: Reboots into recovery mode, very useful for restoring the system or installing updates.
  • adb shell: Opens a Unix/Linux console on the device, allowing advanced internal commands to be executed.
  • adb logcat> logcat.txt: Keeps a complete record of system operations, essential for detecting errors or abnormal behavior.
  • adb install path/app.apk: Install an app from your computer.
  • adb uninstall package: Uninstall an app, ideal for removing bloatware or problematic apps.
  • adb push local destination_path: Send files from your computer to your mobile.
  • adb pull local_source_path: Download files from your mobile to your computer.
  • adb backup -f backup.ab -apk -all: Backs up all compatible apps and data.
  • adb restore backup.ab: Restores a previously generated backup.
  • adb bugreport directory: Generates a complete error report with logs, records, and stack traces, ideal for sending to support or further analysis.

Tip: These commands can be used in both normal mode and recovery mode. If you have root access (in an emulator or with root permissions), you can go even further in terms of diagnosis and repair.

How to tell if your Android camera is working properly
Related article:
How to fix common camera issues on Android phones

Fastboot: What is it and how does it differ from ADB?

Fastboot is the perfect complement to ADB when the device is in bootloader mode . It allows you to modify firmware, unlock the bootloader, flash system, recovery, or radio images, and even restore a bricked phone.

Key differences: While ADB interacts with the already loaded Android system (in normal or recovery mode), Fastboot operates directly on the partitions, even if the system is damaged or won't boot. It's the emergency tool when everything else fails.

Warning: Using Fastboot incorrectly can render your phone unusable. Always make a backup and understand it thoroughly before proceeding.

Main Fastboot commands

  • fastboot devices: Lists devices connected in bootloader mode.
  • fastboot oem unlock: Unlock the bootloader (on some phones you need a code from the manufacturer and you will lose all your information).
  • fastboot flash partition file.img: Flashes an image to a specific partition (boot, recovery, system, etc.).
  • fastboot flashall: Flash all images at once.
  • fastboot boot file.img: Boots an image without installing it (ideal for testing or temporary repairs).
  • fastboot oem device-info: Displays information about the bootloader status (whether it is locked or unlocked).
  • fastboot reboot: Reboot the device to normal mode.

Remember: Fastboot commands only work when the device is in bootloader mode. If it's not, you can use `adb reboot-bootloader` to reboot and activate it.

Troubleshooting ADB: Steps and Recommendations

ADB makes it easy to identify both hardware and software errors . Some of the most common problems you can identify and fix are:

  • The device is not detected: Check that USB debugging is enabled, the drivers are installed correctly, and the cable is working properly. Use adb devices to check the connection.
  • No devices appear when using adb devices: Try restarting the ADB server (adb kill-server and then adb start-server), reconnect the USB, change ports, or try another cable.
  • Wi-Fi connection problems: Make sure your PC and mobile are on the same network. Use adb connect ip:port after enabling wireless debugging.
  • The emulator is not listed.: Ensures that the server starts before the emulator and that the ports are available.
  • Problems with pre-installed apps or bloatware: You can disable or directly uninstall apps from the manufacturer without root, using ADB commands or the package manager.

If you continue to experience problems, the `adb logcat` command allows you to examine the system logs in detail and pinpoint the source of the errors. And if you need an even more comprehensive diagnosis, `adb bugreport` compiles everything you need into a file that you can send to support or analyze at your leisure.

Advanced administrators: am, pm, and dpm

ADB allows the use of advanced system administration tools :

  • am (Activity Manager): Launches activities, stops processes, broadcasts intents, or modifies screen properties. For example, adb shell am start -a android.intent.action.VIEW to open a URL.
  • pm (Package Manager): Manage app packages, permissions, users, or system details. Example: adb shell pm uninstall com.package.app to remove an application from the system.
  • dpm (Device Policy Manager): Ideal for business environments, it allows you to control administrators, profiles or enforce security policies.

These tools make diagnostics much more accurate and help you automate certain tasks when managing multiple devices, whether in development or production.

Extra utilities: captures, recording, backup and restoration

ADB goes far beyond pure diagnostics . It offers practical utilities for capturing device status, recording the screen, creating backups, and efficiently transferring files. For example:

  • Screenshots: adb shell screencap /path/screen.png followed by adb pull /path/screen.png to save it to your computer.
  • Screen recording: adb shell screenrecord /path/demo.mp4, cut with Ctrl+C and adb pull to download the video.
  • Backup and restore: adb backup y adb restore allow full backups of compatible apps and data (note: some apps may not be fully compatible).

You can also manipulate SQLite databases if you have root access and get error reports both from the device itself and through Google Play Console or Firebase Crashlytics, essential tools for developers.

Safety tips and best practices

The potential of ADB and Fastboot comes with certain risks . Don't forget these recommendations:

  • Always make a backup before any major operation.
  • Familiarize yourself with the commands before jumping in with advanced actions such as flashing firmware or unlocking bootloaders.
  • Avoid using these tools if you have no prior knowledge.An incorrect command can render your phone unusable or void the manufacturer's warranty.
  • Consult guides and specialized forums , the XDA Developers to make sure of every step.
  • Always use reliable USB cables and ports to avoid disconnections during critical processes.
  • Keep drivers and tools updated to ensure compatibility and stability.

If you have any doubts, it's best to leave it to someone with experience. And if you decide to take the plunge, start with a phone you don't mind too much, just in case.

Mastering ADB and Fastboot opens the door to troubleshooting any problem that arises on your Android device . From system errors to custom firmware installations, knowing and practicing the commands will give you the confidence to resolve issues independently and safely.


Add as preferred source in Google