Useful Android* Debug Bridge Commands Part 2: Create a Device Backup

ID 662777
Updated 2/12/2016
Version Latest



Eric Payne
Owner at Elite Computer Repair

For this tutorial you will need to have ADB installed on your computer, your Android's USB Debugging set to ON and your device plugged into your computer! Ready?

Today, we're going to make a full backup of your Android device. This backup doesn't take up any space on your Android and, you can restore your backup just by plugging your device into your computer!

First, on your computer, let's make a new folder somewhere handy (mine's on my Desktop) and, name it "Android Backup". Next, open your new folder and right-click on an empty space and select "Open in terminal" (for Windows, press and hold 'Shift' when you right-click).

The first command we're going to look at is:

~$ adb backup -all

After you press 'Enter', you will be asked to confirm this on your Android device. Set a password if you want your backup to be encrypted or, just leave it blank and tap "Back up my data".

Backups can take awhile, so, be patient! Your terminal will show you when it's completed. Do not close the terminal before it completes or your backup wont work!

When it's done, you'll have a new file in your Android Backup folder called "backup.ab". However, technically, you've only backed up the device data and the app data, not any of your .apk files! To do this we add the "-apk" attribute. Example:

~$ adb backup -all -apk

  • Add " -system" or " -no system" if you want to backup just system apps or exclude system apps.

There are more attributes you can add but, now, it's time for the second half of the tutorial.

Here is how to restore your Android device with the backup we just made:

~$ adb restore /file/you want/to restore

Here is where I like to use the drag n' drop trick. Type, "adb restore " (space after restore). Then drag n' drop the backup.ab file onto the terminal and press 'Enter'.

That's it! Now you know how to backup and restore your Android device using ADB!

Stay tuned for the next edition:

Useful ADB commands III

For more information about ADB backup please go here.