Skip to main content

How to root, flash twrp, unlock bootloader and install custom ROM via Linux

People often find difficulties in downloading and installing usb driver for their phone on Windows operating system. But if you are using Linux operating system then things are much simpler for you. This is a generic flow of customizing your android device.

Advantages of using Ubuntu or any Linux distribution for rooting are,
  • You don't need usb driver specific to your phone. 
  • Linux generic driver supports all android devices.
  • ​ADB and fastboot are readily available in Ubuntu's inventory. You could simply install those.
Follow below steps for rooting or install custom ROM,

Intsall ADB and fastboot in Linux

Open a Terminal and install tools from your Linux repo,
For Debian/Ubuntu users,
sudo apt install android-tools-adb android-tools-fastboot 

For Fedora/SUSE users,
sudo yum install android-tools

Download TWRP image and SuperSu zip

TWRP - This opensource project allows us to install custom ROMs safely.
Installing TWRP will enable option to root your device.
Download latest TWRP image or one supporting your device.
Official website for downloading TWRP -

SuperSU - Another popular tool for rooting devices. SuperSU can provide super user privileges to apps which enables them to unlock more features.
Download latest SuperSU zip file or one supporting your device.
SuperSU official website -

Unlock device BootLoader

Next, we are going to unlock android device's bootloader.
Follow steps,

1.Enable developer option in device (Tap on build number few times (Settings -> About Phone -> Build Number)).
2.Enable USB debugging option (Select the option from Settings-> Developer Options -> Enable USB debugging)
3.Connect android device to PC.
4.Open Linux shell and type this command to reboot device to fastboot mode.
sudo adb reboot bootloader
Now your android device will be rebooted to fastboot mode.
5.Check if the device actually listing in shell by using below command.
fastboot devices
This will list all available devices.
6.Unlock bootloader using below command,
fastboot oem unlock
If your device have an unlock code use this,
fastboot oem unlock <unlock_code>
Now your device is unlocked.

Flash TWRP image via fastboot

1. Use the following command on the directory where twrp image is present.
fastboot flash recovery
2. Reboot the device using reboot command,
fastboot reboot

Root android using SuperSU

1. Copy file "" to the root directory of your memory card.
2. Power off the device.
3. Power on device to recovery mode (For most devices you need to keep pressing power button and vol+/vol-).
4. Now you will be seeing TWRP menu on the device.
5. Select install option and select your file. Wait for some time and the device will be rooted.

Flash custom ROM to android device.

1. Copy the .zip file contains custom ROM to the root directory of memory card.
2. Power on device to recovery mode.
3. Select install option and select your .zip file. Wait for some time and the device is up with new ROM.

* Please make sure to use files developed for your device, else you won't be getting any positive results.


  1. Basically I use the kingroot apk for rooting my device for free. I think it's the best tool for rooting than others...


Post a Comment

Popular posts from this blog

Setting up Python Flask server on internet via Port forwarding

In this post we will cover topics;

Starting a server using Python Flask.Accessing server in Local Network.Adding a Port Forwarding rule in NAT settings.Accessing server in Internet via public IP.Difference between static IP and dynamic IP.

Step 1 :-

As the first step, we need to setup a server on our system.A server exposes your code to a particular port.Some examples are Apache Tomcat, Spring boot (inbuilt), Python Django (inbuilt), Nginx.
Here we have a simple server in Python Flask.

For a GET request in root path the server returns a "Hello World!".That's it.
Going to start the server on my local IP address( at default flask port(5000) using below commands,
$flask run  --host=

Step 2 :-

For security purpose all ports for external communication is closed by router's firewall by default. So no communication can be done to outside world. For same reason our server won't be available to other devices.
For our…

Automate Blog Post creation using Blogger APIs and Python

This article will discuss the following topics,

Blogger's REST APIs.Google's OAuth 2.0 playground.Accessing spreadsheet in Python.Creating blogger posts via Python.An experiment to automate blog post creation when you have structured data. I was searching for IFSC codes for some bank transactions and came across Reserve Bank's website, which has a list of excel files containing Bank Codes, Contact Info and related details of each bank's branch. This time I will be looking towards Bharat co-operative bank of Mumbai. Here is how the corresponding data looks like.
In the above picture, each row represents lots of details about each branch of the Bank. Let's think of creating a list of blog posts where each post gives IFSC codes of a particular branch along with address and contact details.

As the first step, I have created a blog in blogger. In the Blogger dashboard, Please also note the parameter called blog ID which is a kind of unique identifier to the blog. It is …

Creation of Orphan Process in Linux using Python

Hi all,

In this article we will learn about,
Orphan process in Linux/Unix.How orphan process is created ?Creation of orphan process using python.Usage of python modules - multiprocessing , subprocessOrphan Process :-

An orphan process is a child process whose parent got finished or terminated. After the termination of parent process, init process will adopt it.If you look into details, the parent pid(ppid) of an orphan will be 1 which is the pid of init. Sometimes orphan process is intentionally created for certain needs, like if you run an application and you don't want the process created by your application to be killed, even after closing the application.

Creation of Orphan process using Python :-

Here, we are going to create an orphan process through python code.
The logic behind the code is,

Create a process using python multiprocessing module and target function will be parent.
In parent function another process is spawned , making it's target function as child. Using su…