Skip to content

How to take an encrypted backup of your Android device using ADB?

  • by
  • 5 min read

With the advent of cloud storage, people have started backing up their personal information to the cloud without knowing how secure these services are. A lot of the companies offering such services make claims of using high-end encryption techniques such as the AES algorithm to keep your data safe. But time and again, these cloud storage services have been hacked and personal information disseminated.

One of the biggest issues with cloud storage is privacy. Cloud storage companies may be keeping your data secure by using encryption keys, but they are the ones who have the keys, which can be used to decrypt and view the data. Also, cloud service providers have to furnish your personal information to the government if requested.  This shows that cloud service providers can access your data even though they say it’s encrypted.

In this article, I am going to tell you how to take an encrypted backup of your Android device using ADB. But before that, let us understand what ADB is and how does it work.

What is ADB?

The Android Debug Bridge (ADB) is a command-line tool that is used by Android developers to debug apps. ADB allows a user to perform debugging over USB. It performs several other tasks as well. Like providing user access to the Unix shell. It also gives access to some hidden features and can be used to remove bloatware.

How does ADB work?

Three components make up the ADB — client, daemon, and server. The computer from which you connect to the device is known as the client. The daemon is a service that runs on both the computer and the mobile. The server is responsible for transferring data between the two devices.

Also read: What is Firmware? How is it different from software and hardware? (Opens in a new browser tab)

Setting up ADB for back up

To take a backup using ADB, you need to set up your Android device and your laptop.

Setting up android for ADB

To set up your mobile device, go to Settings > About phone > Build number. It’s mostly under About phone option but varies from manufacturer to manufacturer.

Once there, click repeatedly (about seven times) on the same. Doing this will enable developer options on your device. 

Once developer options are activated, go back to your device’s settings, scroll down and tap on System. Here you will find a new option by the name of Developer options; click on that and turn on the toggle button beside USB debugging. You will be prompted to set a password for the same here.

Once you are done with the above-mentioned steps, you need to set up your computer for ADB.

Setting up a laptop for ADB

First, you need to download SDK tools for Android according to your device. Then, follow the instructions given below.

Step 1: You will need to unzip it to C:/ drive. Once extracted, create a folder in C:/ drive by the name ADB and cut files from the newly extracted folder (programmer tools) into the ADB folder. Step 2: Now open the command prompt (cmd) on your PC and enter the command cd c:\adb. You can open the command prompt by searching it in the start menu. Or you can type the Windows key + R and then enter cmd in the window. This command (cd c:\adb) will take you to the adb folder that you created in Step 1. Step 3: Connect your device to the computer using USB. Then type adb devices in the command prompt. If you have done everything correctly till now, you will get a message on cmd showing a list of connected devices. During the same time, you will get a message on your phone to give access to the laptop. Step 4: Now, type adb devices again. This time your device will be authorised. Step 5: Give the following command: adb backupapk -shared -all -f c:\backup -<phonename>.abThen a message will show up on your mobile device asking you to give a password which will be used to encrypt your backup.

Once, you are done with all this, your phone will initiate the backup, which might take a couple of minutes. Once the backup finishes, you will have a new folder in C:/ drive with your phones’ encrypted backup.

Also read: How to use ShareIt to transfer files?

Nischay Khanna

Nischay Khanna

A tech enthusiast, driven by curiosity. A bibliophile who loves to travel. An Engineering graduate who loves to code and write about new technologies. Can't sustain without coffee. You can contact Nischay via email: nischaykhanna@pm.me

>