How to Unlock the Bootloader on Android: Pixel, Xiaomi, Samsung, Motorola and More

Unlocking an Android bootloader the official way, brand by brand: OEM unlocking, fastboot, Xiaomi’s HyperOS application, Motorola and Sony codes, and what you lose.

The bootloader is the first program that runs when your phone starts, and it decides what software may load. Android’s documentation: “LOCKED devices boot only if the loaded OS is properly signed by the root of trust”, while “UNLOCKED devices allow modification.” Phones are sold locked. You unlock the bootloader to install a custom system or root the phone, but unlocking alone changes nothing else; in Sony’s words, “unlocking the bootloader will only allow you to install a custom ROM.”

Every official unlock erases the phone. Android: “To protect user data, all state transitions wipe the data partitions and ask for user confirmation before data is deleted.” Back up first. This guide covers the official route for each brand; rooting itself is in our guide to rooting Android.

What you give up

  • Payments and some apps. Google Wallet’s help page lists phones that “Have an unlocked bootloader” among those where tap to pay may not work. Apps can ask Google’s Play Integrity service about your phone, and on Android 13 and later its device-integrity verdict requires “hardware-backed proof that the device bootloader is locked”. Banking and streaming apps that rely on it may refuse to run.
  • Protected content. Motorola warns that “You will not be able to watch any movies you downloaded”; Sony, that some content may become inaccessible “due to the removal of DRM security keys”.
  • Updates. Sony: “you will not be able to get any more official software upgrades if you unlock the bootloader.” Xiaomi: “Users will no longer receive Xiaomi HyperOS updates if they leave their devices unlocked.”
  • Maker features. On Xiaomi phones, “Some features which require high security level (e.g., Find device, added-value services, etc.) will no longer be available.” On Samsung phones, installing unofficial software trips the Knox warranty bit, “a one-time programmable bit e-fuse”, after which Samsung Pay and Secure Folder stop working for good.
  • Warranty, depending on the maker: see each brand below.
  • A warning at every start. An unlocked phone shows a warning before it boots; Android’s suggested text reads “The bootloader is unlocked and software integrity cannot be guaranteed.”

The general steps

This is how it works on Google Pixel phones, and with small differences on many others.

  1. Developer options. Open Settings › About phone and tap Build number seven times, until you see “You are now a developer!” On Samsung phones it is under Software information; on Xiaomi phones you tap the OS version instead.
  2. OEM unlocking. In Developer options, turn on OEM unlocking, described as “Allow the bootloader to be unlocked”, and USB debugging. Android warns: “Device protection features will not work on this device while this setting is turned on”, so turn it off again if you change your mind.
  3. The computer. Install Google’s SDK Platform-Tools, which contain adb and fastboot. Google: “fastboot is needed if you want to unlock your device bootloader and flash it with a new system image.” On Windows you also need a USB driver: Google’s for Pixel phones, the maker’s for others. “If you’re developing on macOS or Linux, then you do not need to install a USB driver.”
  4. Fastboot mode. Connect the phone and run adb reboot bootloader, or, on Pixel phones up to the Pixel 9a, switch the phone off, then “Press and hold Volume Down, then press and hold Power.”
  5. Unlock. Run fastboot flashing unlock. Google: “If you’re unlocking a pre-2015 device, run fastboot oem unlock.”
  6. Confirm on the phone. The phone shows a warning, with the focus on Don’t unlock: choose unlock with the volume keys and confirm with the power button. If you do nothing for 30 seconds, the screen closes and the command fails. The phone then erases itself and restarts.

When OEM unlocking is greyed out

The line under the setting says why: “Bootloader is already unlocked”, “Connect to the internet or contact your carrier”, or “Unavailable on carrier-locked devices”. Android’s documentation suggests connecting to the internet so the phone can check in, or forcing a check-in by typing *#*#2432546#*#* in the phone app, and adds: “If OEM unlocking remains unavailable, your device might be SIM locked by your carrier and the bootloader can’t be unlocked.”

Brand by brand

Google Pixel

The steps above are Google’s. In 2016 Google said that “Pixel phones purchased from the Google store will ship with an unlockable bootloader”. Pixels locked to a carrier often can’t be unlocked: OEM unlocking stays greyed out, as described above.

Xiaomi, Redmi and POCO

Since HyperOS, unlocking needs Xiaomi’s permission. Its announcement: “the bootloader unlocking permission will only be available to certain users after upgrading to Xiaomi HyperOS”, and “For regular users, it is highly recommended to leave the bootloader locked (default state) and not unlock it.” From Xiaomi’s official guide:

  1. In the Xiaomi Community app, version 5.3.31 or later, open Me › Unlock bootloader and apply. “There is a limit to the number of application quotas per day”; if you see “Application quota limit reached”, try again the next day, Beijing time.
  2. Turn on Developer options by tapping the HyperOS version in Settings › About phone › Detailed info and specs. In Additional settings › Developer options › Device Unlock Status, “if it shows “Locked”, then your device can be unlocked.”
  3. “Insert a SIM Card into your device and connect it to the internet using mobile network data”, then bind your Xiaomi account to the phone in Device Unlock status.
  4. Turn on OEM unlocking and USB debugging.
  5. On a computer, install the Mi Unlock tool and sign in with the same account. Switch the phone off, hold Power and Volume Down to enter Fastboot mode, connect it, and click Unlock.

Under MIUI, Xiaomi made people wait 72 or 360 hours after binding the account before the tool would unlock; it publishes no waiting time for HyperOS. Since late 2025 some sites have reported that the application option disappeared; Xiaomi hasn’t confirmed this, so check the Community app for what it offers you. Reports describe separate, stricter rules for phones in mainland China.

Samsung

Samsung publishes no guide to unlocking the bootloader. On phones that have the OEM unlocking setting, the unlock itself happens in Download mode; our rooting guide describes it, following Magisk’s documentation. Since July 2025, reports say the OEM unlocking option has disappeared on Galaxy phones running One UI 8; 9to5Google: “Samsung is apparently removing the option to unlock your bootloader from Galaxy devices with its One UI 8 update”. Samsung hasn’t commented. If you don’t see the setting, there is no official way to unlock your phone.

Remember the Knox warranty bit: once tripped, Samsung says it “can’t be reverted”.

Motorola

Motorola runs an unlock program on its support site, in Portuguese for Brazil too: you sign in, follow its steps to get your phone’s device ID, and check whether it can be unlocked; if so, Motorola gives you an unlock code. “Most of our latest devices support our bootloader unlock program”, with “restrictions such as carrier exclusive models (ex. Verizon, AT&T, Tracfone)”. The site shows the commands after you sign in. The terms are blunt: “Once you get the unlock code, your device is no longer covered by the Motorola warranty”.

Sony Xperia

Check first: type *#*#7378423#*#* in the phone app, open Service info › Configuration › Rooting Status, and look for Bootloader unlock allowed: Yes. If it says No, the phone can’t be unlocked; two US models, XQ-CT62 and XQ-CQ62, aren’t supported at all. Then turn on OEM unlocking and request a code from Sony’s generator with your IMEI, IMEI 1 on dual-SIM phones. Connect the phone while holding the Fastboot key, usually Volume Up, and run fastboot oem unlock 0x followed by the code. Sony: “we recommend that standard users not unlock the bootloader, as it is unnecessary”, and it “may void the warranty”.

OnePlus

OnePlus’s official unlock page is “only for OnePlus T-Mobile Edition Device”: you request an unlock token, which “may take 1-2 weeks”. For other OnePlus phones there is no official guide; they use the general steps above. Reports describe stricter rules for phones sold in China.

Fairphone

Fairphone no longer uses codes: “You do not need to enter a code anymore.” Turn on bootloader unlocking in Developer options, wait for the verification, then run fastboot flashing unlock and, after a second confirmation, fastboot flashing unlock_critical. Each step erases the phone. Fairphone: “Unlocking the bootloader itself generally does not automatically void the warranty for hardware defects.”

Huawei and others

Huawei stopped issuing unlock codes in 2018, so its phones can’t be unlocked officially. For vivo, OPPO, realme and Nothing we found no official unlock instructions; tools and methods passed around online for them aren’t from the makers.

After unlocking

The phone starts with the warning screen and a fresh setup. From there you can root it with Magisk or a kernel-based tool such as KernelSU Next, or try another Android system without replacing yours with DSU Sideloader.

Locking it again

Relocking erases the phone too. Only lock a phone running its complete, unmodified original software: Android says locked devices boot only properly signed software, and Fairphone warns that relocking with older software than before “might brick your phone”. On Pixels, Google’s factory images page says to relock the bootloader after reinstalling, and once a Pixel 10 has the May 2026 update, “you won’t be able to flash and boot older Android 16 builds.” Our rooting guide has the steps.

Apps in this guide

Sources

Related topics