In this article we will see how to perform an Android Backup using the ADB commands.
This method is valid for every smartphone that has Android as its operating system, regardless of the model of our device, it is also not necessary to have root permissions nor the unlocked bootloader. Let's see in detail the procedure to be followed depending on the operating system installed on our PC:
Installation and configuration of ADB with Windows
- Download the Android Developers SDK from Official site.
- Let's go to the download destination folder and extract the SDK, and rename it "sdk".
- open the cmd as an administrator and type:
$ cd Download $ cd sdk $ cd sdk $ cd platform-tools
Let's pause for a moment and see now the procedure valid for the other operating systems.
With MacOS the procedure is the same as Windows.
Installation and configuration of ADB with Linux (Ubuntu / Debian)
open the shell / term and type
sudo apt-get install android-tools-adb
We have finished with the initial configuration, we are ready to backup.
We connect the device to the PC via USB, the correct ADB syntax to create a backup file of our Android is as follows:
adb backup <-f filename.ab>
the available to the user are:
$ -apk | backup of applications and related data. $ -noapk | backup only applications without data. $ -shared | external memory backup (microSD) $ -noshared | does not backup external storage $ -all | relative to the -apk command, select all applications installed on the system $ -f "filename.ab" | backup file name * .ab
To make a complete backup we can use for example:
$ adb backup -apk -all -f galaxyS3_backup_app_20140406.ab
obviously the name of the file you can modify it to your liking, moreover if you use Linux you give the command "sudo -s" before leaving.
After executing the command, on the device you will be asked to accept the backup and if you want, to set an encrypted password.
Let's wait a little while the terminal will continue to show the message "Now unlock your device and confirm backup operation" and when the Backup is completed in the terminal / cmd you will see:
root @ # user-
or C: \ User \ user>
depending on whether you use Windows or Linux. The backup is finished, let's see now how to restore it on the device.
Backup Restore in the Android Device
$ adb restore
$ adb restore galaxyS3_backup_app_20140406.ab
- Confirm the reset from the phone.