How to install stock ROM on any Android device

If you’re a big fan of the Android Operating System, then you will know that custom ROMs are what make the device better. Custom ROMs are refinements to stock Android and they offer a whole host of options including faster performance, improved battery life, better trackball response, and updates directly to the latest versions of Android. There is no denying that custom ROMs are one of the best things about Android!

When it comes to installing a custom ROM on your device though, things can get a little more complicated than just downloading and flashing away. If you’re new to installing custom ROMs, then you might get a little thrown by how long it takes to install a custom ROM and how many steps it takes. So let’s take a look at how to install any custom ROM on any Android device!


Go ahead and check out the links below to get everything that you need to go through this tutorial. 

Download the zip file from the link below or unpack your own zip file with all of these files and place them somewhere safe where they won’t be deleted. 

That’s right, we’re going to be making some changes in recovery mode so the first thing that you need is an unlocked bootloader. If you’re not sure how to unlock your bootloader, then check out this guide on how to unlock the bootloader of your device.

 You will also need to be familiar with ADB and/or fast-boot mode if you’re using a Nexus device (check out our guide on how to use ADB and fast-boot in Android) as well as have the custom recovery of your choice installed.

A custom recovery is a must because it is used for installing the custom ROMs, so go ahead and flash TWRP Recovery or ClockworkMod Recovery onto your device before you continue.


What you need:

Your stock ROM (the one your device came with)

A custom ROM of choice (the one you want)

ADB and fast-boot mode on your PC

A custom recovery like a custom ROM or ClockworkMod Recovery (the one you want)

A MicroUSB/Type-c cable to connect your phone to your PC

Your phone’s bootloader needs to be unlocked. If you don’t have the original firmware, then check out this guide on how to unlock the bootloader of your device


When both have been unlocked, it is recommended that you make a backup of everything in case something goes wrong or if you change your mind about what you are doing. Go ahead and copy the files from your Android device to a safe location on your PC. If they are just saved in My Documents or a similar folder, then you may want to move them to an external hard drive for safekeeping. Remember that these are all encrypted with DRM which is a form of Digital Rights Management (DRM), so you can’t use them again if you restore them back onto your phone!

In case you’re wondering, the DRM file is called ‘factoryfs.img’. It’s a big file and if it gets corrupted or deleted then it will need to be downloaded again. To do this, go to the official Motorola website and search for your device. You’ll see a list of firmware files (firmware is basically the same as stock ROM) so download the one that says it is for your device. It will download as a zip file. Keep this file somewhere safe where you can find it again!


Step 2: Extracting the factoryfs.img file


The factoryfs image contains everything that is in your stock ROM including all of your apps, texts, settings, downloads and so on which is why it needs to be extracted before you can install it onto your custom ROM. Open a command prompt window on your PC and navigate to the folder containing the factoryfs.img file. In the recovery mode section below, you’ll find the exact location of this file depending on which custom recovery you are using.


If you don’t know where to find it, then type “cd” without quotes in your command prompt window and hit enter. This changes the directory so now you need to manually navigate to where your factoryfs.img file is located on your computer using ‘cd’ without quotes again and hitting enter each time until you get to where it is.

Type “adb pull /sdcard/factoryfs.img “/sdcard/factoryfs.img” in the command prompt window and press enter

The file factoryfs.img has now been pulled onto your PC and you can go ahead and place it into a folder on your computer just like above.


Step 3: Copying the stock ROM onto the device’s storage 


Back in recovery mode, select “Wipe Data/Factory Reset” to wipe out any data on your Android device and then select “Install zip from sd card” to choose where you extracted the factoryfs file so that you can install it onto your custom ROM. Navigate to where you have saved the factoryfs.img file and then select it to install it onto your device.


Step 4: Installing the custom ROM on your Android


Go ahead and flash the ROM by selecting “Install” from the main menu of TWRP Recovery or ClockworkMod Recovery. TWRP is known as Team Win Recovery Project, while ClockworkMod is known as CWM, so just make sure you know which one you are using. Once it has been installed, check the instructions here which will tell you how to reboot into your newly-installed custom ROM, and then check out our guide on how to set up a custom recovery.


If you would prefer to get the guide in video form, then you can watch it here.

If there is something that isn’t working as it should be then you can always proceed with the factory reset method which will wipe out everything on your device and revert it back to how it was when you first bought it. This will also work if you have flashed a custom ROM and something isn’t working or if one of your apps is causing problems with your Android phone. To do this, simply follow the instructions here and then reboot your Android again to get back to where you were in terms of settings and apps.

If you still have any doubts just go to this XDA link: https://www.xda-developers.com/how-to-install-custom-rom-android/