Motorola

Motorola Moto G4

Complete firmware flashing guide for the Motorola Moto G4 using Motorola flashfile.bat / CFC XML Script. Covers all XT variants, bootloader unlock, and step-by-step instructions.

Motorola Moto G4 May 2016
Models
XT1621, XT1622, XT1624, XT1625, XT1626
CPU
Octa-core Cortex-A53 (4×1.5 GHz + 4×1.2 GHz)
GPU
Adreno 405
RAM
2GB / 3GB / 4GB
Storage
16GB / 32GB (expandable via microSD)
Display
5.5" IPS LCD, 1080×1920, 401 ppi
Battery
3000mAh (non-removable)
OS
Android 6.0.1 Marshmallow (official OTA to 7.0 Nougat on most variants)
Connectivity
4G LTE, Wi-Fi b/g/n/ac, Bluetooth 4.1, microUSB 2.0
Colors: Black White

About the Motorola Moto G4

The Motorola Moto G4 (codename: athene) is a mid-range Android smartphone released in May 2016, powered by the Qualcomm Snapdragon 617 (MSM8952) chipset. Motorola distributed it across five XT hardware variants, each split further into subsidy-specific builds for different carriers and regions.

Each subsidy build carries a unique radio (modem) firmware — using the wrong build's package is a permanent error. The Prerequisites and Firmware Package sections below explain how to identify your exact build and select the correct package before you begin.

Which Flash Mode Should You Use?

Motorola Rescue and Smart Assistant

Motorola's official PC-based rescue tool can re-flash the device in certain scenarios and may not require a manually unlocked bootloader. Download from Motorola's support site, connect the phone via USB, and follow the on-screen instructions. Limited to Motorola-approved firmware versions and may not cover every subsidy build.

How to enter
Connect phone via USB and open Rescue and Smart Assistant
Requires
Windows PC, Motorola USB drivers, internet connection

EDL / QFIL (Emergency)

The Snapdragon 617's Emergency Download mode is accessible via test points when the device is fully unresponsive. Requires Qualcomm programmer files not publicly distributed by Motorola. Not a standard user-accessible path — used only by service centres with proprietary tools. If mfastboot and Rescue and Smart Assistant both fail, contact Motorola support directly.

Requires
Qualcomm programmer file (not publicly distributed by Motorola)

What You Need Before Flashing

1
Windows, Mac, or Linux PC

Required to run mfastboot commands and the flashfile script. Install Android SDK Platform Tools plus a Motorola-flavoured mfastboot binary — some CFC XML packages use flags stock fastboot doesn't support. Motorola USB drivers are required on Windows for the device to be recognised in Fastboot mode.

2
Unlocked bootloader

Flashfile XML flashing is only possible with a previously unlocked bootloader. Request your device-specific unlock code at motorola.com/unlock-bootloader using your IMEI and Android ID — note the Amazon Prime Exclusive XT1625 (AMZ) is not eligible while under the Amazon subsidy. The unlock wipes the device once — complete this before downloading firmware.

3
Correct XT model and subsidy package

Download the CFC XML / factory image package that matches both your exact XT model number and subsidy tag (e.g. RETUS, AMZ, CCAWS, TESCOEU, MOVSTLA, LATAM). Confirm in Settings → About Phone → Model Number and cross-check with fastboot getvar all. The wrong subsidy package carries a different radio firmware and will corrupt cellular connectivity if flashed.

4
USB data cable

A data-capable USB cable is essential — charge-only cables do not support Fastboot communication. Use the original Motorola cable or a known-good data cable. Avoid USB hubs; connect directly to a port on your PC.

5
Battery at 50% or above

The flashfile script writes multiple partitions over several minutes. Unlike the Moto G4 Play, the Moto G4's 3000mAh battery is non-removable — a power-off during radio or bootloader partition writes can cause a hard brick with no way to swap the battery. Charge to at least 50% before starting, and keep the USB cable connected throughout.

6
Full data backup completed

Both the bootloader unlock step and the flashfile script wipe all user data. Back up photos to Google Photos, contacts to Google Contacts, and app data or documents to a PC or cloud service before beginning.

How to Flash the Motorola Moto G4 — Quick Overview

7-step quick reference for the Motorola Moto G4. Need visuals or troubleshooting help? The full Motorola flashfile.bat / CFC XML Script guide covers everything in detail.

  1. Identify your exact XT model and subsidy/branch
  2. Request your bootloader unlock code and back up all data
  3. Download the CFC XML / factory image package matching your build
  4. Install Motorola USB drivers and mfastboot
  5. Boot into Fastboot mode and run the flashfile script
  6. Wait for completion and confirm IMEI/network on first boot
  7. Re-lock the bootloader if you want official OTA updates (optional)

Finding the Firmware Package for MSM8952

The Moto G4 firmware is distributed as a factory image / CFC XML package containing separate .img files for each partition plus a flashfile.xml or flashfile.bat script that mfastboot reads to flash partitions in the correct order. After extracting the package, locate:

flashfile.xml

This file is inside the CFC XML / factory image archive. After extracting, look for flashfile.xml or flashfile.bat at the top level of the extracted folder, alongside individual .img files for each partition. Do not run the script from inside a compressed archive — fully extract to a folder on your PC before executing.

The Moto G4 (codename: athene) has five XT hardware variants, each split further into subsidy/carrier-specific builds (e.g. RETUS, AMZ, CCAWS, TESCOEU, MOVSTLA, LATAM) with their own radio (modem) firmware and CID: XT1621 (base ATHENE CID50, plus MSTLA, LATAM, and MOVSTLA subsidy builds), XT1622 (base ATHENE CID50, plus TESCOEU for Tesco Mobile Europe), XT1624 (base ATHENE, with an early and a later Nougat build), XT1625 (RETUS for US retail, AMZ for the Amazon Prime Exclusive unit, CCAWS for Canadian carrier units), and XT1626 (base ATHENE). Always match both the XT number and the subsidy tag in the filename — two builds can share an XT number and Android version yet still carry different, incompatible radio images.

Before flashing, run fastboot getvar all to read the device's current CID — this confirms which subsidy package is actually compatible, since outward branding does not always match the provisioned CID. A CID mismatch is the most common cause of a "Preflash validation failed" bootloader rejection (see Common Errors below).

Packages may ship as flashfile.bat + flashfile.xml, or as a CFC.xml-based archive — both work the same way once extracted and run through mfastboot.

Note: The Moto G4 Plus (XT1640/XT1642/XT1643, codename: griffin) is a different device with a fingerprint sensor and different partition layout. Its factory images are incompatible with the plain Moto G4 (athene). Never flash Moto G4 Plus images on a Moto G4 or vice versa.

Motorola Moto G4 Firmware Versions

Known stock firmware releases for the Motorola Moto G4. Always verify the version matches your device's exact XT model and subsidy before flashing.

Version Region Android Version Size MD5 Download
MPJ24.139-23.4 / CID50 XT1621 — ATHENE (CID50) Android 6.0.1 1.05 GB ⬇️ Download
NPJS25.93-14-10 / MSTLA XT1621 — MSTLA Android 7.0 1.06 GB ⬇️ Download
NPJS25.93-14-15 / subsidy-LATAM XT1621 — LATAM Android 7.0 1.07 GB ⬇️ Download
MPJ24.139-23.4 / subsidy-MOVSTLA XT1621 — MOVSTLA Android 6.0.1 1.06 GB ⬇️ Download
MPJ24.139-48 / CID50 XT1625 — RETUS Android 6.0.1 1.05 GB ⬇️ Download
NPJ25.93-14.7 / CID50 XT1625 — AMZ Android 7.0 1.3 GB ⬇️ Download
NPJS25.93-14.7-5 / subsidy-CCAWS XT1625 — CCAWS Android 7.0 1.06 GB ⬇️ Download
MPJ24.139-23.4 / CID50 XT1622 — ATHENE (CID50) Android 6.0.1 1.06 GB ⬇️ Download
NPJS25.93-14-18 / subsidy-TESCOEU XT1622 — TESCOEU Android 7.0 1.07 GB ⬇️ Download
NPJ25.93-11 / CID50 XT1624 — ATHENE (early Nougat) Android 7.0 1.05 GB ⬇️ Download
NPJS25.93-14-18 / CID50 XT1624 — ATHENE (later Nougat) Android 7.0 1.07 GB ⬇️ Download
MPJ24.139-23.1 / cid50 XT1626 — ATHENE Android 6.0.1 1.10 GB ⬇️ Download

More builds and newer regional variants may be added over time. View the source listing on AndroidFirmwareFile.com →

Motorola Moto G4 — Important Notes

Motorola released official Android 7.0 Nougat factory images for several Moto G4 subsidy builds — including MSTLA and LATAM XT1621 units, TESCOEU XT1622 units, both XT1624 builds, and AMZ/CCAWS XT1625 units — while some CID50 base builds remained on 6.0.1 Marshmallow longer. Check the firmware table above for a Nougat-labelled build matching your exact XT number and subsidy before attempting an upgrade flash.

Unlike the Moto G4 Play's removable battery, the Moto G4's 3000mAh battery is sealed in. There is no way to pull the battery mid-flash if it drains, so charge to at least 50% and keep the USB cable connected throughout — a power interruption during the bootloader or radio partition writes is the scenario most likely to require Motorola Rescue and Smart Assistant or a service center to recover.

Common Errors on the Motorola Moto G4

"waiting for device" — mfastboot does not detect the phone

mfastboot cannot see the device. On Windows, check Device Manager for "Android Bootloader Interface" while the phone is in Fastboot mode — if it shows as unknown, reinstall the Motorola USB drivers. Use a data-capable USB cable and a USB 2.0 port rather than USB 3.0. Confirm the phone is actually showing the Fastboot logo, not a normal boot screen.

FAILED (remote: 'Bootloader is not unlocked')

The bootloader must be unlocked before any flashfile.xml flash. Complete the unlock process at motorola.com/unlock-bootloader with your IMEI and Android ID, then in Fastboot mode run fastboot oem unlock UNLOCK_CODE. This wipes the device and reboots it. Re-enter Fastboot mode and run the flashfile script again afterward. Note this option is not available on the Amazon Prime Exclusive XT1625 (AMZ) build.

flashfile.bat fails instantly / "Image not found" error

The flashfile script must be executed from within the extracted CFC XML / factory image folder — it references .img files and flashfile.xml by relative path. Do not double-click flashfile.bat from Windows Explorer; instead, open Command Prompt, navigate (cd) to the extracted folder, and run flashfile.bat from there. Also verify the archive was fully downloaded — a truncated ZIP produces an incomplete extraction with missing .img files.

FAILED (remote: 'image is not for this device')

The package you downloaded does not match this unit's XT number and subsidy. The bootloader checks the device/CID identifier embedded in the CFC XML package against the phone's provisioned CID and rejects mismatches. Confirm your XT number in Settings → About Phone, run fastboot getvar all to read the current CID, and download the package built for that exact combination from the firmware table below.

Device stuck on Motorola logo after flashing

An interrupted flash leaves one or more partitions inconsistent. Re-enter Fastboot mode (hold Volume Down + Power for 8–10 seconds) and re-run the flashfile script from scratch using the same package. If Fastboot mode is no longer reachable, Motorola Rescue and Smart Assistant can recover some units that are otherwise unresponsive to mfastboot commands.

(bootloader) Preflash validation failed

The bootloader rejected one or more partition images before writing, usually because the package's signed CID doesn't match the device's provisioned CID, or its security version is older than what's already flashed (anti-rollback). Run fastboot getvar all to confirm the device's current CID and only flash a package built for that exact CID/subsidy — this is a protective check, not damage, and should never be forced through.

IMEI reads 0/unknown or "No Service" after flashing

Almost always caused by flashing a package for the wrong subsidy build within the same XT number — each subsidy carries its own radio/modem image. Re-flash the package that exactly matches your XT number and subsidy tag from the firmware table below; the flashfile process does not normally touch the modemst1/modemst2 (EFS) partitions, so a correctly matched re-flash usually restores network function.

For the full Fastboot error database: Fastboot Error Directory →

Frequently Asked Questions — Motorola Moto G4

Ready to Flash?

Follow the full step-by-step Motorola flashfile.bat / CFC XML Script guide with interactive progress tracking, prerequisite checklist, and complete troubleshooting.

Open Full Guide