Obtaining root access on Android allows access to hidden system functions, but requires caution. The method via ADB (Android Debug Bridge) is one of the most universal, as it works even on devices with a locked bootloader (under certain conditions). Unlike one-click utilities like KingRoot, rooting via ADB gives you more control over the process and minimizes the risk of installing malware.
It is important to understand: Manufacturers are actively fighting rooting - on new devices (2023+), unlocking the bootloader can lead to hardware locking of functions (for example, NFC or camera failure). However, for experienced users, ADB remains the most reliable way to root most models Samsung, Xiaomi, Google Pixel and other brands. This article covers current methods for 2026, including bypassing new restrictions.
What is ADB and why do you need it for rooting
ADB (Android Debug Bridge) is a tool from Google, designed for debugging Android devices via the command line. In the context of rooting, it performs three key functions:
- ๐ Unlocking the bootloader โ without this step, installing a custom recovery or firmware from root is impossible on 99% of devices.
- ๐ฅ File transfer โvia ADB you can download
Magisk.ziporTWRP.imgdirectly to the device memory, even if the internal storage is encrypted. - ๐ ๏ธ Executing commands โfor example,
adb shellallows you to run scripts to bypass protection (DM-Verity, SAR).
The main advantage of ADB before other methods - transparency of the process. You see every command you execute, unlike "black boxes" like Framaroot or Towelroot. This is especially important for devices with Dynamic Partition (introduced in Android 10+), where incorrect rooting can lead to data loss on all logical devices. sections.
Preparing the device: USB debugging and OEM unlocking
Before connecting to ADB, you need to activate hidden developer options and enable two key parameters:
- Activate developer mode: Go to
Settings โ About phone โ Build numberi tap on it 7 times. On some devices (for example, Xiaomi c MIUI 14+), you may need to enter your account password Mi. - Enable USB debugging: In the menu that appears
For developersactivate the switchUSB debuggingOn Samsung One UI 6.0+ this item may be calledUSB debugging (Security settings). - OEM unlocking: In the same menu, find the option
OEM unlocking(orOEM UnlockingOn devices with Android 13+ this). the item may be hidden - its appearance depends on the manufacturer's policy.
On some models (for example, Google Pixel 7/8 or Samsung Galaxy S23+), OEM unlocking requires linking an account Google or Samsung for up to 7 days. This is an anti-theft measure, but it also makes it difficult to root โcleanโ devices without linked accounts.
Battery charge > 50%|USB Type-C cable (original or certified)|ADB drivers installed on PC|Data backup created|Lock screen password/PIN disabled (recommended)-->
โ ๏ธ Attention: On devices with Android 12+ and hardware protection AVB 2.0 (for example Qualcomm Snapdragon 8 Gen 2+), unlocking the bootloader resets all data, including the contents of the internal memory and SD card (if encrypted). This is an irreversible process - backup is required!
Installing ADB and Fastboot on a computer
To work with ADB you will need:
- ๐ฅ๏ธ A computer running Windows 10/11, macOS or Linux (instructions for each OS are different).
- ๐ Cable USB Type-C with support for data transfer (charging cables are often not suitable).
- ๐ฆ Minimum package Platform Tools from Google (weighs ~5 MB, in difference from the full one Android Studio).
Download the latest one Platform Tools from the official website Google and unpack the archive to the root of the disk C:\ (for example, C:\platform-tools\This will simplify working with the command line. For Windows you will additionally need:
- Install drivers Google USB Driver (for devices Pixel) or drivers from the manufacturer (for example, Samsung USB Driver).
- Add path to
platform-toolsto environment variablePATH(instructions for Windows 11:Start โ Settings โ System โ About โ Advanced system settings โ Environment variables). - Disable driver signature verification (only for Windows), since some custom recovery (TWRP) require unsigned drivers.
Check the installation is correct by running on the command line:
adb version
If the command displays the ADB version (for example, Android Debug Bridge version 1.0.41) - the installation was successful.
On macOS and Linux before using ADB for the first time, you may need to grant permissions to execute scripts: chmod +x ~/platform-tools/adbAlso on macOS Ventura+ you need to allow the terminal access to the device in System settings โ Confidentiality.
Unlocking the bootloader via Fastboot
Most modern devices (with the exception of some models Xiaomi and Realme) require unlocking the bootloader before rooting.
| Manufacturer | Unlock command | Features |
|---|---|---|
| Google Pixel | fastboot flashing unlock |
Requires confirmation on the device. Pixel 6+ resets data even when re-locked. |
| Samsung | fastboot oem unlock |
On Exynos-chips may be required oem unlock go. On Snapdragon-models (for example, Galaxy S22), unlocking is blocked by Samsung Pay i Secure Folder. |
| Xiaomi/Redmi/Poco | fastboot oem unlock |
Requires account linking Mi and waiting 72โ168 hours (for MIUI 14+). Some models (for example, Redmi Note 12 Pro+) only support fastboot oem unlock-bypass. |
| OnePlus | fastboot oem unlock |
On OnePlus 11+ the unlocking resets. data even on non-system partitions (including /data/media). |
General sequence of actions:
- Turn off the device and hold down the combination to enter
Fastboot(usuallyVolume down + Power). - Connect the device to PC and run the command:
fastboot devices
If the device is listed (for example, 1234abcd fastboot), enter the unlock command for your manufacturer.
โ ๏ธ Attention: On devices with Android 13+ the feature Dynamic System Updates (DSU) unlocking the bootloader may result in loss of installation capability OTA updates. In this case, to update the system, you will need to manually flash the full image (fastboot update).
Installing Magisk via ADB (method without TWRP)
For devices where installation TWRP is difficult (for example, on Samsung s One UI 5.0+ or Google Pixel 7+s, there is a method of rooting through patching boot.img using Magisks. This method works even on devices with A/B sections s. separate recovery).
Action algorithm:
- Download the latest version Magisk (for example
Magisk-v26.4.zip) from official repository. - Extract
boot.imgfrom the firmware of your device (you can download the full image from the manufacturerโs website or extract viapayload-dumper-go). - Transfer
boot.imgto the device and patch it through the app Magisk (in the menuInstall โ Select and Patch a File). - Copy the resulting file
magisk_patched-XXXX.imgback to the PC. - Flash the patched one
bootvia Fastboot:
fastboot flash boot magisk_patched-XXXX.img
fastboot reboot
For devices with A/B-partitions (most modern smartphones) use:
fastboot flash boot_a magisk_patched-XXXX.img
fastboot flash boot_b magisk_patched-XXXX.img
What to do if Magisk does not detect boot.img?
If Magisk gives an error This file does not seem to be a boot image, most likely, your device uses init_boot instead of boot.img (relevant for Android 13+ on Pixel 7/8, Samsung Galaxy S23 etc.). case:
1. Extract init_boot.img from the firmware.
2. Patch it via Magisk.
3. Flash with command fastboot flash init_boot magisk_patched-XXXX.img.
Solving common errors when rooting ADB
Even if you follow the instructions exactly, errors may occur. Here are the most common and ways to eliminate them:
| Error | Cause | Solution |
|---|---|---|
waiting for any device |
ADB does not see the device |
|
FAILED (remote: 'Flashing is not allowed...') |
The bootloader is not unlocked | Run fastboot flashing unlock_critical (for Pixel) or check the unlock status via fastboot oem device-info. |
Invalid sparse file format at header |
Damaged boot.img |
Download the original boot.img from the firmware for your model (for example, with XDA Developers or SamMobile). |
This package is for "XXX" devices; this is a "YYY". |
Model mismatch | Check the model code in fastboot getvar product and download the firmware specifically for your device. |
If after rooting the device is stuck on the logo (bootloop), try:
- Delete cache data:
fastboot erase cache. - Reflash the original
boot.img. - Reset via
fastboot -w(will delete all data!).
โ ๏ธ Attention: On devices with Android 14+ and Virtual A/B function (for example, Pixel 8 Pro), incorrect rooting can lead to loss of access to thesuperivendorpartitions. In this case, full rooting will be required. flashing viafastboot updatewith the official image.
Security after rooting: MagiskHide, SafetyNet and banks
Obtaining root access automatically makes the device vulnerable to:
- ๐ก๏ธ SafetyNet blocking โmany banking applications (SberBank, Tinkoff) and games (Pokรฉmon GO, Genshin Impact) refuse to work on rooted devices.
- ๐ Data leaks โ some applications (for example, Facebook or VK) can collect information about root status.
- ๐ซ Hardware limitations โ on Samsung Knox flag is triggered, which blocks
0x1what blocks Samsung Pay and Secure Folder forever.
To minimize risks:
- Activate
MagiskHide(in Magisk settings) and add banking applications to the hidden list. - Install the module Universal SafetyNet Fix to pass certification Google Play Protect.
- Use Island or Shelter to isolate applications in a separate profile without root.
- Disable root for specific applications via
DenyListin Magisk.
Check the SafetyNet status with the command:
adb shell su -c "snet check"
If result ctsProfile: false, it means that the device did not pass the test. In this case:
- Update Magisk to the latest version.
- Remove all modules except SafetyNet Fix.
- Try changing the device fingerprint via module MagiskHide Props Config.
Even with successful completion of SafetyNet, some applications (for example, Netflix or Disney+) may block playback in HD due to the presence of root. In this case, the module MagiskHide Props Config with the registered fingerprint of a certified device (for example, Google Pixel 6).
Alternative rooting methods (if ADB doesn't work)
If rooting via ADB is not possible (for example, due to a locked bootloader or missing boot.img), consider alternatives:
- ๐ฑ TWRP + Magisk: Suitable for devices with an unlocked bootloader. Requires installing a custom recovery. (TWRP or OrangeFox).
- ๐ง One-Click utilities: For example, Dr.Fone - Root or iRoot. They do not work on all devices and may contain backdoors.
- ๐ Custom ROM firmware: Some firmwares (for example, LineageOS or Pixel Experience) already include root. The downside is the loss of original functionality (for example, camera Samsung or Xiaomi).
- โ๏ธ Cloud rooting: Services like Rootjunky offer remote rooting via TeamViewer. Risky from a security point of view.
For devices with MediaTekprocessors (for example, Realme, Oppo) sometimes the method works via SP Flash Tool:
- Download Scatter file for your model.
- In SP Flash Tool select
Download Onlyand specify the path to the patchedboot.img. - Connect the switched off device to the PC (without battery, if possible).
โ ๏ธ Attention: On devices with Android 13+ and chipsets MediaTek Dimensity 9000+ use SP Flash Tool may lead to hardware locking of IMEI. Before flashing the firmware, be sure to backup the partitionnvramviaadb backup.
FAQ: Frequently asked questions about rooting via ADB
Can I get root without unlocking the bootloader?
On most modern devices (2020+) - no. Exceptions:
- Devices with vulnerabilities in the kernel (for example, DirtyCow or CVE-2023-21036), but they are quickly closed by updates.
- Some models Xiaomi s MIUI 12 and below (via exploit FastbootD).
- Devices on Android 8.0 and below (via utilities like KingRoot, but this is not safe).
On Android 11+ even temporary root (via adb shell) requires an unlocked bootloader.
How to check if root is obtained?
Run in terminal:
adb shell
su
If instead of an error you see a prompt root@device:/ # - root is working. You can also install the application Root Checker from Google Play.
Is it possible to cancel rooting?
Yes, for this:
- Flash the original
boot.imgvia Fastboot. - Remove Magisk through its menu (
Uninstall โ Complete Uninstall). - For a complete reset, do
fastboot -w(will delete all data).
On some devices (for example Samsung), even after removing the root, the flag Knox remains triggered, which blocks some functions.
Does rooting void the warranty?
Yes, but:
- Manufacturers cannot always determine the fact of rooting if you roll back all changes.
- On Samsung i LG a counter is triggered Knox or LGE Root Check, which is reset only through the official service.
- In the EU and some countries (for example, the USA), denial of warranty due to rooting can be challenged by law Magnusson-Moss Warranty Actif the failure is not related to root.
How to update a rooted device?
Standard OTA updates on rooted devices devices lead to loss of root or bootloopAlternatives:
- Download the full firmware image and flash it manually via Fastboot, then repeat the rooting procedure.
- Use the module Magisk Delta for automatic OTA patching (does not work on all devices).
- For Pixel and some Xiaomi you can use the script FlashFire (outdated, but sometimes it works).
On Android 14+ c Virtual A/B Updates via OTA are not possible - only full firmware.