- Download the fastboot ROM suitable for your device from Lolinet and extract the downloaded archive.
cd
into the directory where it was extracted, as this is where you'll be doing everything in this guide.
Note
Lolinet's storage is sorted by the phones year of production and region. There is a description in each year's folder which will show you the codename/folder for each phone in that production year. You might want to stick to the Retail ROMs (starting with RET), either Global (RETAIL) or specific for your region (RETAPAC for Asia-Pacific) to help avoid carrier specific apps etc.
- Download and extract the official Android SDK Platform Tools or install them using your package manager of choice.
- If you are using the official platform tools, make sure
adb
andfastboot
(components of platform-tools) are in your path
$ export PATH=path/to/android/sdk/platform-tools:$PATH
- Make sure you have Python3 installed, and then install motoflash2sh and run it to generate the shell script for flashing your device. Also make sure the resulting shell script is executable.
$ pip3 install https://github.com/dlenski/motoflash2sh/archive/master.zip
$ motoflash2sh flashfile.xml
Wrote shell script with 52 fastboot steps to flashfile.sh
$ chmod a+x ./flashfile.sh
- Make sure your device is sufficiently charged, connect your device to your computer using a USB cable and enable USB Debugging in your device's settings. Check if your device is detected.
$ adb devices
- If device is listed, reboot to bootloader.
$ adb reboot bootloader
- Check if your device is detected by fastboot.
$ fastboot devices
You may need to use sudo
before fastboot
if you get a permission denied error.
Warning
You are about to flash the ROM. Flashing the generated flashfile.sh
as is will perform a clean flash (aka. wipe the phone storage). A clean flash is always recommended. If for some reason you want to perform a dirty flash while updating (to keep your data), edit flashfile.sh
and remove the lines that say fastboot erase userdata
and fastboot erase metadata
.
Only ever perform a dirty flash if your phone is updated as far as you can within Android (OTA) and you're upgrading to a ROM version above that which hasn't been fully released in your region yet (aka. you can't get by OTA/in Android System Updates). Dirty flashing can easily brick the phone, due to any number of unknown variables that would otherwise be wiped. But as you're flashing a ROM, so you have already backed up your data just in case... haven't you?
- Run the script
$ ./flashfile.sh
Note
You may need to run sudo ./flashfile.sh
if you had to use sudo
with fastboot
-
Sit back and relax while the shell script automatically flashes your fresh Motorola ROM.
-
Once it has finished, run
fastboot reboot
. The first boot can take quite a bit of time as the fresh ROM gets things ready. Don't panic, this is normal.