Not every phone will allow it. All phones in the world are divided into two types: those that allow unlocking the bootloader, and those that do not allow. Whether you can unlock the bootloader depends on the phone manufacturer, model, and even your carrier. All Nexus phones can be unlocked from birth, and on many Motorola and HTC phones, you can unlock the bootloader using a method similar to Nexus. However, there are phones, as well as some operators that do not allow unlocking the bootloader officially, which means that if you want root access, you will have to wait until the developers check the security vulnerability. If you have such a phone – this guide, alas, will not help you. The easiest way to find out which of these categories your phone is in is to find information about it on XDA Developers. If you have HTC or Motorola, you can also study the possibility of unlocking it on HTC or Motorola. If it doesn’t support unlocking, you’ll have to use unofficial unlock or rutting methods – they can usually be found on the XDA Developers forums. If your phone supports more official unlock paths – read on.  

Step 1: Back Up Everything Valuable

Before we begin, it is important to know: this process will erase all data. So if you have a photo or some other valuable files for you, save them to your computer. In addition, if you want to save the application settings, use the export settings to save them to backup files, and transfer these files to the computer too. And here’s another personal tip from me: if I’m firmly convinced that I’ll rut the phone, I’ll unlock the bootloader as soon as possible after purchasing it. Then you don’t have to spend time on settings just to erase everything and adjust it on a new one in a few days. So if you are a fan of digging into the deep Android settings and intend to rotate the phone, it’s best to unlock it right away before messing around with the settings. When you have made all the necessary backups, you can continue.  

Step 2: Install the Android SDK and Phone Drivers

 

  You need two things: Android Debug Bridge, a command-line tool for a computer that allows you to connect a computer to your phone, and USB drivers for your phone. Even if you have already installed them before, install the latest versions. Download Android SDK

Open the Android SDK download page and scroll down to the “SDK Tools Only” section. Download the ZIP archive for your platform and unpack it where you want to save the ADB files.Launch the SDK Manager and deselect all but the “Android SDK Platform-tools”. If you have a Nexus phone, you can also check out “Google USB Driver” to download drivers from Google.After installation is complete, close the SDK Manager.Install USB drivers for your phone. They can be found on the website of the phone manufacturer (for example, Motorola or HTC). If you have a Nexus, you can install the Google drivers that you downloaded in step 2.If the computer says that you need to restart, restart it.

Turn on the phone and connect it to the computer with a USB cable. Open the Platform-tools folder in the Android SDK folder and, holding Shift, right-click on an empty space. Select “Open Command Window” and enter the following command: If the serial number is shown, your device is recognized and the procedure can continue. If not, make sure you follow the steps above exactly.  

Step 3: Enable USB Debugging

Next, you need to enable some features on the phone. Open the application panel, click settings and then “About phone”. Scroll down and click “Build Number” seven times. You will see a message stating that you have become a developer. Return to the main settings page, and you will see a new item – “For Developers”. Open it and activate “Unlock OEM”, if this item is there (if it is not there, do not worry – it is necessary only on some phones). Next turn on “USB debugging”. Enter your password or PIN if required. After that, connect the phone to the computer. A pop-up window “Allow USB debugging?” It should appear on the phone. Check “Always allow on this PC” and click OK.  

Step 4: Get the unlock key (for phones other than Nexus)

If you have a Nexus, you can skip this step. Owners of other devices may have some more work to do. Open the unlocking page of the manufacturer of your phone, select your device (if necessary) and log in or create an account.   Further actions are somewhat different depending on what kind of phone you have, but the manufacturer’s website should contain instructions on what to do next. And in general, the following should be done: First, turn off the phone and turn it on in fast boot mode (Fastboot). On different phones, this is done a little differently, but on most modern devices just hold down the “power” and “volume down” buttons for 10 seconds. Release the buttons and the phone will boot into Fastboot mode (HTC owners first need to select “Fastboot” with the “Volume Down” button and press the power button to confirm the selection). You will most likely find more information on this process in Google search, which is recommended to be done before continuing.   Connect the phone to the computer with a USB cable. The phone will indicate that the device is connected. On the computer, open the Platform-tools folder in the Android SDK folder and, holding Shift, right-click on an empty space. Select “Open command window” and use the command window that opens to get the unlock key according to the instructions of your phone manufacturer. For example:   The command window will display a token in the form of a very long string of characters. Select it, copy and paste it into the appropriate box on the manufacturer’s website (no spaces, this is important!) And send a request. If your device can be unlocked, you will receive an email with a key or file that you will use in the next step. If your device cannot be unlocked, you will receive a message about it. If you want to get root access or flash ROM, use informal methods – you will find descriptions of them on resources like XDA Developers.  

Step 5: Unlock the phone

Now everything is ready to unlock. If the phone is still in Fastboot mode, run the command below. If not, turn off the phone and hold down the “power” and “volume down” buttons for 10 seconds. Release and the phone will boot into Fastboot mode (HTC owners must first select “Fastboot” with the “Volume Down” button and press the power button to confirm the selection). On the computer, open the Platform-tools folder in the Android SDK folder and, holding Shift, right-click on an empty space. Select “Open Command Window”. To unlock the device, you need to enter one simple command. For most Nexus, the command will be as follows: If you have a newer Nexus, for example, 5X or 6P, the command will be slightly different If you do not have a Nexus, the manufacturer of your device will tell you which command to enter.  For example, for Motorola devices, you need to enter the below code using the unique key that you received. For HTC devices, enter the following code using the Unlock_code.bin file you received from HTC. Make sure to use the location of .bin file. After running the command, the phone may ask if you really want to unlock. Confirm with the volume button.   When finished, use the on-screen menu to restart the phone (or run the command fastboot reboot from your computer). If everything is done correctly, at the beginning of the download you will see a message saying that the bootloader is unlocked, and after a few seconds, Android should boot. It is important to allow Android to load before doing something else, for example, flash custom recovery. Congratulations, you have unlocked your phone! At first glance, you will not see significant differences, but unlocking the bootloader opens up the possibility of root access and firmware custom recovery.