These are the instructions to root Motorola Moto G XT1031 smartphone running on the Android 4.4.2 KitKat update. The guide uses the CF-Auto-Root tool which is most famously known for rooting Samsung devices. There are a select few devices that can run the CF-Auto-Root outside of the Samsung range too. The devices that are not made by Samsung utilize adb and fastboot and not the Odin flashing tool.
You are voiding the warranty Motorola instates by customizing your device with root access or if you go on to install a custom recovery.
- You must unlock the bootloader on the Motorola Moto G smartphone before you can follow this guide and root the device. You can follow the same guide we made for unlocking the Motorola Moto G 2015 bootloader  and get that done.
- You can use this guide on the Motorola Moto G with the model number XT1031 only. Do not try flashing this CF-Auto-Root file on any other device or it will get bricked.
BEFORE WE BEGIN
- Some Motorola Moto G owners might need to unlock the Developer Options menu by tapping on the Menu > Settings > About Device > Build Number 7 times.
- Enable the OEM unlock on your Motorola Moto G smartphone by tapping on the Menu > Settings > Developer Options > OEM Unlock.
- Enable the USB Debugging Mode by tapping on the Menu > Settings > Developer Options > USB Debugging Mode.
- Download the universal ADB driver  to the computer before you start the guide and get it running. You will need the adb driver to help your fastboot pick up your Moto G handset. Only then will you find everything works.
HOW TO ROOT MOTOROLA MOTO G XT1031 RUNNING ON ANDROID 4.4.2 KITKAT
- Download the CF-Auto-Root package for the Moto G XT1031 from this link .
- Extract the CF-Auto-Root file to the desktop by right-clicking the file and choosing the “extract here” option.
- Learn how to set up adb  on your Windows computer.
- Boot the Motorola Moto G smartphone in fastbot mode by holding the Volume Down + Volume Up + Power buttons.
Double-click the mouse over the rooting script file you get after you extracted the original CF-Auto-Root zip file.
- Follow the on-screen instructions and you’re done.
Now you can find out how to install TWRP Recovery on the first-generation Motorola Moto G  smartphone so you can start flashing your custom ROMs, custom kernels, other device modifications and take compete backups for the first time without any help from adb command.
The Motorola Moto G smartphone is well-known for giving users an experience that’s pretty close to stock Android anyway, so the upside of rooting this device isn’t going to be with removing bloatware. With that being said, there are still many reasons to root the Motorola Moto G smartphone, including installing apps that can increase your battery life, increase your device’s performance, offer better backup solutions and more. Couple that with a custom recovery and you can then go on to install custom kernels, custom ROMs like CyanogenMod, take even better backups with the NANDroid option and install the NANDroid manager application so you can restore individual partitions at a time.