When a phone gets damaged, you change devices, or you simply want a safety net, a full backup is the most reliable way to keep your apps, settings, and personal data intact. While cloud services cover photos and contacts, they rarely capture every app’s private files or the exact system configuration. Using the Android Debug Bridge (ADB) you can create a local, device‑wide backup without ever rooting the phone.
adb platform‑tools installed.adb backup command, but many manufacturers still honour it, and a fallback method using adb shell tar works on all versions.Download the official Android SDK Platform‑Tools package for your OS:
platform-tools_windows.zipplatform-tools_mac.zipplatform-tools_linux.zipExtract the archive to a convenient location (e.g., C:\adb or ~/adb). Add the folder to your system PATH or use the full path when invoking commands.
adb devices
xxxxxxxxxxxx device. If it says unauthorized, a dialog appears on the phone – tap Allow and optionally check “Always allow from this computer”.There are two reliable ways to back up a device without root:
.ab file that can be restored with adb restore. Works on most Android 4.4‑11 devices.adb shell tar to archive the /data and /sdcard partitions into a .tar file. Works on any Android version, but requires a bit more post‑processing.We’ll cover the standard method first because it’s the simplest for most users.
adb backupadb backup -apk -shared -all -f full-backup.ab
-apk – includes the APK files of installed apps.-shared – backs up the shared storage (photos, downloads, etc.).-all – backs up all user apps and their data.-f – specifies the output file name.Backup finished: xxxx bytes. Verify that full-backup.ab exists and its size matches expectations (usually a few hundred MB to several GB).The -apk flag ensures you can reinstall apps without needing the Play Store, which is handy for devices without Google services. -shared captures the user’s media files, while -all tells ADB to include every user‑installed app. If you only need app data, you can drop -apk and -shared to shrink the backup.
A backup file can be corrupted without obvious signs. Quick checks:
ls -lh full-backup.ab (Linux/macOS) or dir full-backup.ab (Windows).android-backup-extractor (see the optional section below)..ab File for InspectionSometimes you may want to inspect the contents without a full restore. The open‑source tool android-backup-extractor (abe) converts .ab to a .tar archive.
abe.jar file.java -jar abe.jar unpack full-backup.ab backup.tar
backup.tar with any archive tool to view individual app data folders.adb devices.adb restore full-backup.ab
After reboot, you should see all your apps, contacts, messages, and media exactly as they were at the time of the backup.
.ab file. Verify the password and re‑run the command.-apk during backup, only app data is restored. Re‑install the missing apps from the Play Store, then launch them once to allow data restoration.adb shell tar method (next section) or reinstall the app and use its own import feature.adb shell tarIf your device runs Android 12+ where adb backup is disabled, you can still archive the data partitions directly.
adb shell
run-as trick for each app, or simply back up the public partitions:
cd /sdcard && tar -cvf /sdcard/userdata.tar .
exit) and pull the archive to the PC:
adb pull /sdcard/userdata.tar ./userdata.tar
/data partition (requires the device to be in adb root mode, which most production devices do not allow). For a non‑root device you can only capture what is readable from /sdcard and the app‑specific data you can access via run-as.
adb push userdata.tar /sdcard/adb shell "cd /sdcard && tar -xvf userdata.tar"
This method is more manual but works on any Android version, and you can combine it with run-as per‑app backups for critical apps.
If you want a scheduled backup without manual intervention, you can create a simple script on your PC. Below is a Bash example for Linux/macOS; Windows users can adapt it to a batch file or PowerShell.
# backup.sh – creates a dated ADB backup
#!/bin/bash
DATE=$(date +%Y-%m-%d_%H-%M)
FILE="android-backup-$DATE.ab"
adb backup -apk -shared -all -f "$FILE"
if [ $? -eq 0 ]; then
echo "Backup saved as $FILE"
else
echo "Backup failed"
fi
Make the script executable (chmod +x backup.sh) and schedule it with cron (e.g., 0 2 * * * for a daily 2 AM backup).
| Symptom | Possible Cause | Fix |
|---|---|---|
| ADB reports "device unauthorized" | USB debugging not confirmed on phone | Check the prompt on the device, tap Allow, and enable "Always allow". |
| Backup file is 0 KB | Phone denied the backup request | Make sure you tapped Back up my data on the dialog. If the dialog never appears, toggle USB debugging off/on and reconnect. |
| Restore fails with "Failed to read backup" | Corrupted .ab file or wrong password | Verify file integrity (compare checksum), re‑enter the correct password, or create a fresh backup. |
| Missing media after restore | Used -shared flag omitted | Re‑run backup with -shared or manually copy media from the old device. |
| App data not restored for certain apps | App opted out of ADB backup (e.g., WhatsApp, Signal) | Use the app’s own export feature (e.g., WhatsApp chat export) or backup its private folder via run-as if you have the package’s debug flag. |
ADB backup shines when you need a complete snapshot, including app APKs and private data that cloud syncs skip. It is also useful for devices without Google Play Services, for custom ROMs, or when you want a quick offline copy before flashing a new firmware.
For everyday photo or contact sync, Google Drive, OneDrive, or native device backups are more convenient. Use ADB backup as a supplemental safety net before major changes (OS upgrade, custom ROM flashing, factory reset).
With the steps above you now have a reliable, repeatable workflow to back up your Android phone locally and restore it whenever needed – all without rooting or paying for third‑party software.









