TWRP is the premiere recovery for Android because of how many devices it supports and how easy it is to use. But installing it in the first place has not always been the easiest thing to do – until now. With the help of a Magic module, you can finally use an Android device to flash TWRP on another.
Google removed Android's original ability to send ADB and Fastboot commands to other devices in an earlier version, but this mod returns that feature. Developers osmosis and Surge1223 are the ones who made the magic happen, so great props for them for their work. The first installation is the longest part of it all, but once it's done, it's easy to maintain in the future.
You need two Android devices for this to work, and one should already be rooted. The already rooted drive will take the place of the computer in this case.
On the Android device with root access, open the Magic Manager, press the menu on the left and then go to "Downloads." Click the search icon and then enter "adb" to find the ADB & Fastboot for Android NDK module. Click the download arrow, press "Install" and then press the "Restart" button to activate the module.
Now you need to take the TWRP image file for the device you want to install the custom restore on. Grab your TWRP image from the link below and save it to the "Download" folder on of both devices . Also change the file to "twrp" to make it easier for later in the wizard.
Step 3: Install the Termux app
To use the Magic module you installed from step 1, you need a terminal app. Termux is one of the best such apps, so look up the link below to get it installed on your already rooted device.
- Play Store Link: Termux (free)
Go to target phone, go to Settings -> About phone and press on "Building Number" 7 times fast to activate developer options. When you're done, go to developer options either from Settings -> System -> Advanced or from the bottom of your Settings app. Finally, enable the "USB debugging" option.
Step 5: Connect the two Android devices
If both phones were made in recent years, you only need one standard USB C cable to connect them. One with the modern, reversible connector on both sides. But if one or both phones have a micro USB port, you can find adapters on Amazon using the links below.
Step 6: Allow USB debug mode  When the two Android devices are connected, the target phone should display a new popup immediately. If this does not happen, try removing and connecting the USB cable of the secondary device. Now click "Always allow from this computer" followed by "OK" to confirm the selection.
Open the Termux app on the rooted device, type the following command and then press on enter.
This triggers a superuser request from Magical, which is required when running higher level commands. Click "Grant" when prompted, then you are ready here. You must run the "su" command before sending ADB or Fastboot commands each time, but you will not have to grant the superuser request again.
Just because two devices are connected to each other does not mean that they are actually communicating properly. To check this, type the following command on the rooted device through Termux, and then press enter.
The above command controls all connected devices that can communicate via the ADB interface. If everything worked as intended, you should see a device ID under the line "List of connected devices".
Before you can run any Fastboot commands, you must start your secondary device to a special location for just that. On the rooted device with Termux, type the following command, and then press enter.
adb reboot bootloader
This will send the secondary device to its original bootloader menu, also called "Fastboot Mode."
At this point, you must redirect Termux so that it can find the twrp.img file that you downloaded from step 2. Use the same rooted device terminal and type the following then press enter.
cd / sdcard / Download
As mentioned, it will redirect the location of the terminal window to the "Download" folder on your rooted drive. This is the specific location where the twrp.img file is, so make sure you specify the command exactly as it appears.
Step 11: Check your partition layout
Now it's time to send over twrp. img file to the secondary device so you can have TWRP installed on it. But the instructions are different depending on whether the target phone supports Android 7.0's A / B partition layout.
So first, if you are not sure if the phone you want to install TWRP on has A / B partitions, install Treble Check from the Play Store. Open the app and it will say either "Unsupported" or "Supported" in the section Seamless System Updates . If your phone is supported, you have A / B partitions and should follow the corresponding instructions in the next step.
Step 12: Install TWRP
If you have a A / B partition target device, open the Termux app on the host device and type the following command and then press enter.
fastboot boot twrp.img
This will temporarily launch TWRP on the secondary device; but you still have to run the permanent installer after that. If you do not, TWRP will disappear after restarting the unit.
So press "Install", browse to folder Download and then press "Install Image" button. Click the twrp.img file, select "Install Recovery Disk", and then drag the slider to begin. When the process is complete, press the home button, go to "Restart", then "Reset", where you are greeted by the permanent version of TWRP!
If the target phone does not have A / B partitions open Termux on the rooted device and type the following command and then press enter.
fastboot flash restore twrp.img
This command installs TWRP permanently on your device without any extra work on your part due to how devices with an "A-only" partition layout work. The last thing you need to do is type the following command and then press enter.
adb reboot recovery
At this point, your secondary device will now automatically launch to the TWRP main menu. You can safely remove the USB cable or OTG adapter now. You have TWRP installed and can do whatever you want with the popular custom recovery without being tied to a computer.
to help support Gadget Hacks and get a lot on some cute new technology? Check out all offers at the new Gadget Hacks Shop .