Open Termux and update the packages:
Step-by-Step Guide: Unlocking the Bootloader via Termux Link
For most modern devices (Pixel, OnePlus, Motorola), execute: fastboot flashing unlock Use code with caution. For older Android devices, use the legacy command instead: fastboot oem unlock Use code with caution.
Plug the into the host phone (the one running Termux). Connect the standard USB data cable to the OTG adapter. Plug the other end of the data cable into the target phone .
Some manufacturers (like Samsung, Huawei, and newer Verizon-branded devices) strictly block bootloader unlocking or require proprietary tokens. This method works best on devices from Google (Pixel), OnePlus, Xiaomi, and Motorola. 🛠️ Hardware Requirements: The "Two-Device" Setup
What are the exact of both your host and target phones?
Because an Android device cannot execute Fastboot commands on itself while in bootloader mode, you must link two devices together.
Xiaomi requires a specific process. You can use the termux-miuiunlockr script to handle token generation and flashing 1.2.5 .
Tap 7 times until "Developer Options" is enabled. Go back to Settings > System > Developer Options .