ADB / Fastboot

ADB Backup and Restore: Back Up Android Without Root

Published: June 25, 2026 Applies to: Windows 10/11, macOS, Linux — Android 4.0 through Android 15

adb backup is a built-in Android tool that lets you create a local backup of app data, SMS messages, and certain system settings on a Windows, macOS, or Linux PC — no root access required. While Google has deprecated the feature in newer Android releases in favor of Google's cloud backup, it remains functional on most devices through Android 15 and is still the best way to make a local, offline copy of app data before wiping a device.

Prerequisites and Limitations

Before using adb backup, understand these constraints:

Running a Basic Backup

With USB Debugging enabled and the ADB connection authorized, run:

adb backup -apk -shared -all -f backup.ab

Flag explanations:

A confirmation dialog appears on the phone. You can optionally enter a backup password to encrypt the .ab file. If you set a password, record it — there is no recovery mechanism. Tap Back up my data to start. The terminal shows no progress during backup; wait until the phone screen returns to normal and the .ab file stops growing in size.

To back up only specific apps rather than everything:

adb backup -apk com.example.app1 com.example.app2 -f apps.ab

Replace the package names with the actual app package IDs. You can find an app's package ID with adb shell pm list packages.

Backing Up SMS Messages

SMS messages are stored by the default messaging app. To back them up:

adb backup -noapk com.google.android.apps.messaging -f sms.ab

Replace com.google.android.apps.messaging with the package name of your default SMS app if it is different (Samsung Messages is com.samsung.android.messaging, MIUI Messages is com.android.mms). The -noapk flag skips the APK file and only saves app data, which is all that matters for SMS restoration.

Restoring from an ADB Backup

To restore data from a backup file:

adb restore backup.ab

A confirmation dialog appears on the phone. If the backup was encrypted with a password, enter it on the phone (not the PC). Tap Restore my data. Restoration can take several minutes to several hours depending on backup size. The phone must remain connected and unlocked throughout.

Important restoration considerations:

Understanding the .ab File Format

The .ab (Android Backup) format is a custom compressed archive. Its structure is:

To inspect the contents of an unencrypted backup without restoring it, you can extract it on Linux or macOS with:

dd if=backup.ab bs=24 skip=1 | python3 -c "import zlib,sys; sys.stdout.buffer.write(zlib.decompress(sys.stdin.buffer.read()))" | tar -tv

This skips the 24-byte header, decompresses the zlib stream, and passes the result to tar for listing. Replace -tv with -xv to extract to the current directory. On Windows, third-party tools like Android Backup Extractor (a Java-based tool available on GitHub) can open .ab files graphically.

When ADB Backup Is Not Enough

For apps that block ADB backup, or for complete device images including system data:

Common ADB Backup Errors

"error: device unauthorized": The ADB connection is not authorized. Unlock the phone, check for the authorization dialog, and tap Allow. If no dialog appears, go to Developer Options > Revoke USB Debugging Authorizations, then reconnect.

Backup completes instantly and the .ab file is only a few hundred bytes: This happens when the phone's screen was locked when the backup was started (the confirmation dialog was not tapped). Start the backup again with the phone unlocked and confirm the on-screen dialog within 30 seconds.

"adb: error: cannot backup: no such file or directory" when specifying a path: Ensure the directory for the output file exists. Use a simple filename in the current directory first: adb backup -all -f test.ab. If that works, the path for your intended location has an issue (spaces, missing directory, or permission).

Restore completes but app data is missing: The app was included in the backup with allowBackup="false" or the app data was encrypted with a key tied to the original device. Some apps (Google Authenticator, banking apps) intentionally prevent data migration for security reasons. These apps must be set up fresh.