Android Debug Bridge (ADB) is a powerful command-line tool that allows developers to communicate with an Android device or emulator. It's a versatile tool that can be used for a wide range of tasks, such as transferring files, installing apps, debugging applications, and accessing the device's shell for more advanced actions. Here's a deep dive into some advanced uses of ADB:
Setting Up ADB
Before diving into advanced tasks, ensure ADB is set up on your computer:
- Install Android SDK Platform-Tools: Download and install from the Android developer website.
- Enable USB Debugging on Device: Go to Settings > About phone, tap "Build number" seven times to enable Developer options, then enable USB Debugging.
- Connect Device: Use a USB cable to connect your Android device to your computer.
Advanced ADB Commands
1. Wireless ADB
- Connect Over Wi-Fi:
- Connect the device using USB and enable TCP/IP on your device with:
adb tcpip 5555 - Disconnect USB and find the device’s IP address (Settings > About phone > Status).
- Connect using IP:
adb connect <device_ip_address>:5555
- Connect the device using USB and enable TCP/IP on your device with:
2. File Transfer
-
Push a File to the Device:
adb push <local_file> <remote_path>
Example:adb push myfile.txt /sdcard/Download/ -
Pull a File from the Device:
adb pull <remote_file> <local_path>
Example:adb pull /sdcard/Download/myfile.txt ./


