Android Debug Bridge (ADB) is a versatile command-line tool that enables developers and power users to communicate with an Android device. It is used for a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that can be used to run a variety of commands on a device.
Here’s a quick guide on utilizing ADB effectively:
Setting Up ADB
-
Install ADB: You can install ADB as part of the Android SDK Platform-Tools package. Download it from the Android developer site for your OS (Windows, macOS, or Linux).
-
Enable USB Debugging on your Device:
- Go to Settings > About Phone.
- Tap on Build Number 7 times to unlock Developer Options.
- Go back to Settings and enter Developer Options.
- Enable USB Debugging.
-
Connect Your Device: Plug your Android device into your computer using a USB cable.
Basic ADB Commands
-
adb devices: Lists all connected devices. It shows the List of connected devices with their serial numbers. If your device is properly connected, it should appear here.
-
adb push <local> <remote>: Copies a file from your computer to your device. For example,
adb push myfile.txt /sdcard/myfile.txt. -
adb pull <remote> <local>: Copies a file from your device to your computer. For example,
adb pull /sdcard/myfile.txt ./myfile.txt. -
adb install <apk>: Installs an APK onto your device.
-
adb uninstall <package-name>: Uninstalls an app from your device using its package name.
-
adb shell: Starts a remote shell on your device. This allows you to access the Unix shell of the device for advanced commands.
Advanced Use
-
Logcat: Use
adb logcatto view and filter logs generated by your applications. This is essential for debugging. -
Screen Record: Record the screen of your Android device using
adb shell screenrecord /sdcard/demo.mp4. -
Wireless ADB: You can connect to your device over Wi-Fi. First, connect your device via USB, then:
adb tcpip 5555 adb connect <device_ip_address> -
Backup and Restore: Use
adb backupandadb restoreto backup and restore your entire device. -
Reboot into Recovery/Bootloader: Commands like
adb reboot recoveryoradb reboot bootloaderare used to reboot the device into different modes.
Security and Permissions
Ensure your device's security settings permit ADB connections and that you're mindful of the permissions, especially when enabling wireless debugging.
This guide should help you begin leveraging ADB for a wide range of tasks on your Android device. Remember, using ADB commands can affect your device significantly, so proceed with care, especially when executing commands that modify system files.


