ADB (Android Debug Bridge) is a versatile command-line tool that lets you communicate with a device. Using ADB shell commands, you can perform various advanced operations on Android devices. Here are some advanced tips for utilizing ADB shell commands:
1. Setup ADB
Before using ADB shell commands, ensure that:
- ADB is installed on your computer. You can download it as part of the Android SDK Platform-Tools.
- USB Debugging is enabled on your Android device from Developer Options.
- Your device is connected to your computer via USB.
2. Basic ADB Commands
-
Connect your device:
adb devices- Lists all connected devices.
-
Access the device shell:
adb shell- Opens a command shell on the device.
3. Advanced ADB Shell Commands
System Information and Configuration
- Get device model:
adb shell getprop ro.product.model - List all system properties:
adb shell getprop
File Management
-
Push a file to the device:
adb push <local_file> <remote_location>- Example:
adb push C:\file.txt /sdcard/Download/
- Example:
-
Pull a file from the device:
adb pull <remote_file> <local_location>- Example:
adb pull /sdcard/Download/file.txt C:\
- Example:
App Management
- List installed packages:
adb shell pm list packages - Install an app:
adb install <path_to_apk> - Uninstall an app:
adb uninstall <package_name>
Debugging and Monitoring
-
View logcat:
adb logcat- Displays the real-time log.
-
Record screen:
adb shell screenrecord /sdcard/demo.mp4- Records the device screen and saves it to the specified location.
Network Configuration
-
Set up port forwarding:
adb forward tcp:<host_port> tcp:<device_port>- Forwards a host port to a device port.
-
Ping from the device:
adb shell ping <address>- Test network connectivity.
Factory Reset and Recovery
- Reboot the device:
adb reboot - Reboot into recovery mode:
adb reboot recovery - Reboot into bootloader:
adb reboot bootloader
Exploring System Internals
- List running processes:
adb shell ps - Access system directories:
adb shell ls /system
Modify System Settings
- Change display density (DPI):
adb shell wm density <value> - Change screen resolution:
adb shell wm size <width>x<height>
4. Security and Privacy
- Be cautious when executing commands that alter system settings or root access.
- Always back up important data before making substantial changes to system files or configurations.
5. Scripting and Automation
- ADB commands can be scripted or automated using batch scripts or shell scripts, which is helpful for repetitive tasks.
By using these advanced ADB shell commands, you can extend your control over Android devices, customizing and managing them more efficiently.


