Termux runs while Android is fully booted. It cannot reboot the device into the specific bootloader mode required to unlock it, nor can it bypass the security checks implemented by manufacturers.
How to unlock bootloader using an Android Phone? (Android-Android) ... MOB = Which Device will be used for unlocking bootloader. . unlock bootloader using termux link
While many devices use standard fastboot oem unlock commands, brands like require specific proprietary handshakes involving a Mi Account and a unique token. Developers have created specialized scripts, often hosted on GitHub , to automate this within Termux. offici5l/MiTool - GitHub Termux runs while Android is fully booted
On the device you are using as the "computer," install Termux and run these commands: Update packages pkg update && pkg upgrade Install ADB & Fastboot pkg install android-tools Step 3: Connect the Devices Connect the two phones using a USB OTG adapter (the OTG end goes into the Host/Termux phone). In Termux, check if the device is recognized: adb devices Accept the USB debugging prompt on the Step 4: Unlock the Bootloader Reboot to Bootloader/Fastboot adb reboot bootloader (Alternatively, use adb reboot fastboot if your device supports the newer fastbootd mode) Verify Fastboot Connection fastboot devices Run the Unlock Command (Android-Android)