The Custom Droid

Android Tutorials, Tips and Tricks

How to take an ADB backup of your phone using TWRP

ADB Backup using TWRP

TWRP has been updated to v3.1.0-0. The new version of the recovery is already set and rolling out for the supported devices. Below is the changelog for as mentioned on the official website.


ADB Backup using TWRP

TWRP v3.1.0-0 Changes

  • vold decrypt on a few select HTC devices, TWRP will now attempt to use the system partition’s vold and vdc binaries and libraries to decrypt the data partition (nkk71 and CaptainThrowback)
  • adb backup to stream a backup directly to or from your PC, see documentation here: (bigbiff)
  • tweak MTP startup routines (mdmower)
  • support new Android 7.x xattrs for backup and restore to fix loss of data after a restore (Dees_Troy)
  • support POSIX file capabilities backup and restore to fix VoLTE on HTC devices and possibly other issues (Dees_Troy)
  • better indicate to users that internal storage is not backed up (Dees_Troy)
  • improve automatic determination of TW_THEME (mdmower)
  • minimal getcap and setcap support (_that)
  • try mounting both ext4 and f2fs during decrypt (jcadduono and Dees_Troy)
  • shut off backlight with power key (mdmower)
  • timeout during FDE decrypt (Dees_Troy and nkk71)
  • support for FBE decrypt and backing up and restoring FBE policies (Dees_Troy)
  • boot slot support (Dees_Troy)
  • TWRP app install prompt during reboot (Dees_Troy)
  • support for AB OTA zips (Dees_Troy)
  • support new Android 7.x log command (Dees_Troy)
  • update recovery sources to AOSP 7.1 (Dees_Troy)numerous bugfixes and improvements by too many people to mention

You are now allowed to take Nandroid backups over ADB using TWRP v3.1.0-0. The process, however, can only be initiated from the client side (In simpler words, from your computer). We will talk about it in much detail, a bit later.

The next notable feature being introduced is specific to the Pixel/Pixel XL users with A/B partition format, where the users will now be able to flash alpha/beta OTA update zips from within the recovery.

The update also adds support to a list of new devices, including:

  • HTC U Ultra
  • HTC Bolt/10 EVO
  • Moto G 2015
  • Xiaomi Redmi Note 4/4x
  • Xiaomi Mi Max
  • LG Optimus L7

Go ahead and update to the latest TWRP, either manually or by using the Official TWRP app.

How to take ADB backup using TWRP

Over to the ADB backup functionality that TWRP is offering with its latest update. No, if you’re thinking that you would be able to generate a backup using ADB over WiFi, we are sorry to disappoint but this is not that. You will still need to make a physical connection with the PC using a USB cable.

You can use the command-line tool on your PC to execute the appropriate commands and take the backup of the known partitions of your device.

To begin, you must have ADB set up on your PC. You can simply use the standalone package. And of course, your device must be booted into TWRP recovery and connected to the PC.

  1. On a whole, the ADB backup command follows the below structure.
    adb backup -f <filename> --twrp <options>
  2. The -f switch specifies the filename being added. <filename> could be anything according to your preferences. However, if you choose to leave it empty, the backup will reside under backup.ab, by default.
  3. <options> let you use the following options, depending upon the partitions you want to backup.
    --compress : Compress the data
    system : backup system partition
    cache : backup cache partition
    data : backup data partition
    boot : backup boot partition
    etc : backup each and every partition your device has
  4. Only boot, data, and system partitions are backed up by default. So without any arguments, a generalized backup command would be:
    adb backup --twrp

    TWRP - Default ADB Backup Command

  5. You can make use of the arguments to customize your backup. So a more advanced backup command should look like:
    adb backup -f firstbackup --twrp system data cache boot
  6. As soon as you execute the backup command at the client-side, the backup screen will open on your device. Then unlock your device and confirm the backup process.
    TWRP Confirm ADB Process
  7. You can use the following command on the client side to restore a backup:
    adb restore <filename>


    adb restore backup.ab

View TWRP’s github for complete documentation.

The ADB backup functionality will work with all the supported devices. If your device still hasn’t received the update, you can track the builds here.

Don’t forget to share this article on your social profiles by clicking the buttons below. Didn’t understand something? Let us help you. Just comment below.

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.