translations: [ fr/Français ] · [ es/Español ] · [ de/Deutsch ]
Table of contents
Android Debug Bridge (ADB) and Fastboot are vital tools for Android system management, offering extensive capabilities for device debugging, development, and maintenance. This guide aims to provide an in-depth understanding of these tools, including basic operations, file management, and system state controls.
Prerequisites
- Installation: ADB and Fastboot are part of the Android SDK Platform-Tools package.
- USB Debugging: Enable this on your device under
Settings > About phone > Build number
(tap several times) and then inSettings > Developer options
. - Device Drivers: Install necessary drivers for your specific Android device on your PC.
Understanding ADB
ADB is a versatile command-line tool that allows communication with an Android device for various purposes like installing apps, copying files, and accessing detailed device information.
Basic ADB Commands
List Connected Devices
adb devices
Expected Output:
List of devices attached device_serial_number device
Install an Application
adb install path_to_apk
File Management
Pushing a File to Device
adb push local_file_path /remote_file_path
Pulling a File from Device
adb pull /remote_file_path local_file_path
Understanding Fastboot
Fastboot mode is a diagnostic and engineering tool which allows for the modification of the Android filesystem from a computer when the device is in bootloader mode.
Basic Fastboot Commands
Check Connected Devices
fastboot devices
Flashing a Recovery Image
fastboot flash recovery path_to_recovery.img
Managing Device States
Entering Bootloader Mode
Using ADB
adb reboot bootloader
Using Key Combinations
- Power off the device.
- Hold down specific key combinations (usually Volume Down + Power) until the bootloader screen appears.
Entering Recovery Mode
- Using ADB
adb reboot recovery
Rebooting the Device from Fastboot
- Reboot Command
fastboot reboot
Advanced Operations
Unlocking the Bootloader
- Note: Unlocking the bootloader may void your warranty and erase device data.
fastboot oem unlock
Relocking the Bootloader
fastboot oem lock
Accessing Device Logs
- Useful for debugging applications and system issues.
adb logcat
Created on: Jan 19, 2024
Last updated on: Mar 23, 2024