If you’re interested, you can follow these steps to officially unlock the bootloader of the Moto G4 and the Moto G4 Plus from Motorola.
Unlocking the bootloader of a smartphone will enable you to do other modifications to the device if you so desire. Generally, the method to rooting a smartphone first involves unlocking the bootloader, then installing a custom recovery, and then flashing the SuperSU binaries via TWRP.
With TWRP installed on the Moto G4 and Moto G4 Plus, you can flash various modifications to the smartphone (like Xposed Framework for example). Installing mods and things this way is certainly necessary, but my favorite thing to do with a custom recovery is to create and restore full Nandroid backups. I wish this type of functionality was included in the stock Android experience, but I don’t mind having to go through these steps in order to gain that type of functionality.
So, before we can begin to install TWRP as a custom recovery, we need to unlock the bootloader and that’s what I want to walk you through today.
Note – Unlocking the bootloader will wipe the data you have on your phone. Please backup any important data before starting this tutorial.
Moto G4 Unlock Bootloader
- Enable Developer Mode
- Enable OEM Unlock
- Install the Minimal ADB & Fastboot tools
- Visit the Motorola bootloader unlock website
- Create an account or log into your existing one
- Download and install the Motorola USB drivers from the Motorola page (in step 3)
- Shut down the Moto G4
- Boot the Moto G4 into Fastboot Mode
- Connect the Moto G4 to the PC with a micro USB cable
- Launch the Minimal ADB & Fastboot shortcut that was created (from step 2)
- Type the following into the command prompt. . .
- fastboot oem get_unlock_data
- . . .then press Enter on the keyboard
- Copy the ‘Unlock Data’ code from the command prompt
- Paste it into a blank Notepad file
- Remove any excess characters from the Unlock Data code
- Make sure the Unlock Data code is one long string
- Then copy the Unlock Data code to the clipboard
- And paste it into the Motorola bootloader unlock website
- Click the ‘Can my device be unlocked?’ button on the Motorola website
- Scroll down to the bottom of the page
- Click the ‘I Agree’ option
- Then click the ‘Request Unlock Key’ button on the Motorola page
- Wait for them to email you the unlock code
- Copy the special unlock code from the email
- Type the following command into the command prompt. . .
- fastboot oem unlock [code] (replacing [code] with the special code from the email)
- . . .and press Enter on the keyboard
- Press the Up arrow on the keyboard
- Then press the Enter on the keyboard again
- Press the Power button on the Moto G4 to reboot back into Android
This tutorial may look complicated as it has over 30 different steps to it, but that’s just because I like to break things down into easily understandable steps. If you get confused at all during this process, be sure to check out the embedded video above as I walk you through the entire process while I unlock the bootloader of my Moto G4 Plus on camera. So to start, go ahead and enable Developer Mode so you can toggle the OEM Unlock option on.
You’ll then need to download and install the Minimal ADB & Fastboot tools (if you don’t have them already), along with the Motorola USB drivers. With that done, you can then go ahead and power down the Moto G4 and boot it up into Fastboot Mode (which is also known as Bootloader Mode). You can then connect the Moto G4 or Moto G4 Plus to the PC with a micro USB cable as we need to issue a few commands to the smartphone from the computer.
Launch the ADB & Fastboot shortcut that gets created, and then execute the oem get unlock data command so that we can get the required information. This will give you some text like you see in the image above, and you’ll want to copy the text after the (bootloader) parts into a notepad. You then want to delete all of the stuff so that you’re only left with a single line of the unlock data code. Motorola describes the part you need, and I also show this in the embedded video above too.
From here, you simply need to copy and paste that long unlock data string into the Motorola website so you can ask if the bootloader of your Moto G4 or Moto G4 Plus is unlockable. If it is, you’ll get a big Request Unlock Key button appear at the bottom of the article. Agree to the terms of service and then click that button so that Motorola can send you a special unlock code so we can proceed with the bootloader unlock.
It only took a few seconds before they sent me the code via email, so it should be fast for you as well. We simply need to go back to the command prompt and type out the fastboot oem unlock command and then append the special unlock code to the end of it. You’ll get a warning in the command prompt that says your data will be erased, and that you should execute this command again to actually unlock the bootloader.
So you can just press Up on the keyboard (to bring back the same command you just typed in), and then press Enter to execute it. The unlock process is very quick and you’ll see the screen go black and then go back to the Moto G4 Fastboot Mode. Simply press the Power button (since the Start option is highlighted), and you’ll see the Moto G4 or Moto G4 Plus reboot and go through the typical boot animation sequence before taking you to the Android activation screen.