Introduction / Why This Is Needed
A backup of an Android device's data is insurance against losing important information when changing phones, performing a factory reset, or experiencing hardware failure. Using ADB (Android Debug Bridge) allows you to create a full or partial backup directly from your computer, without needing to install third-party apps on the device. This method is particularly useful for:
- Saving all apps along with their data (if the app permits backup).
- Backing up system settings and files.
- Creating a copy before experimenting with firmware or gaining root access.
After completing this guide, you will have a backup file that can be restored on the same or a different device (considering compatibility).
Requirements / Preparation
Before starting, ensure the following conditions are met:
- A computer running Windows, Linux, or macOS.
- Installed Android SDK Platform-Tools (including ADB). If not, download from the official website and extract.
- An Android device on version 5.0 (API 21) or higher. Note: On Android 10+ without root access, the backup does not include APK files for some apps (especially banking apps and those using protection).
- USB debugging enabled on the device (see step 2).
- A USB cable (preferably original for a stable connection).
- Sufficient free space on the computer to store the backup (size depends on the amount of data on the device).
⚠️ Important: If a password or pattern lock is set on the device, the system may require it to be entered to access data during an ADB backup. Ensure the device is unlocked.
Step-by-Step Guide
Step 1: Install ADB on Your Computer
- Go to the Android SDK Platform-Tools page and download the archive for your OS.
- Extract the archive to a convenient folder, e.g.,
C:\platform-tools(Windows) or~/platform-tools(Linux/macOS). - Add the path to this folder to the system
PATHvariable:- Windows: Control Panel → System → Advanced system settings → Environment Variables → Add the folder path to
Path. - Linux/macOS: Edit
~/.bashrcor~/.zshrc, adding the lineexport PATH=$PATH:~/platform-tools, then runsource ~/.bashrc.
- Windows: Control Panel → System → Advanced system settings → Environment Variables → Add the folder path to
- Verify the installation: open a terminal (CMD, PowerShell, Terminal) and type
adb version. The ADB version should be displayed.
Step 2: Enable USB Debugging on the Device
- Open Settings → About device (or System → About device).
- Find Build number and tap it 7 times. A notification "You are now a developer!" will appear.
- Go back to the main settings menu. The Developer options item is now available.
- Enter Developer options and enable the USB debugging toggle.
- When connecting the device to the computer for the first time, a dialog will appear requesting debugging permission. Check "Always allow from this computer" and click OK.
Step 3: Connect the Device and Check the Connection
- Connect the device to the computer using a USB cable.
- On the device, if prompted, select file transfer mode (MTP) or "Charging only" — ADB works in either case.
- Open a terminal and run:
adb devices - In the device list, you should see a line like:
If the status is<serial_number> deviceunauthorized, check the device screen and confirm authorization. - If the device is not listed:
- Restart ADB:
adb kill-serverthenadb start-server. - Check drivers (for Windows: Device Manager → find the device with an exclamation mark → update driver).
- Try a different USB port or cable.
- Restart ADB:
Step 4: Start the Backup
ADB supports several backup types. For a maximally complete backup (apps, app data, external storage, system apps), use:
adb backup -apk -shared -all -system -f backup.ab
Parameter breakdown:
-apk— save APK files of installed apps.-shared— copy files from external storage (photos, videos, documents on SD card).-all— back up all installed packages (including system and user apps).-system— include system apps (requires root for full data backup on Android 10+).-f backup.ab— specify the output file name (herebackup.abin the current folder). You can replace it with any path, e.g.,-f /home/user/backup_2026.ab.
💡 Tip: If you only want to back up a specific app, specify its package instead of
-all. For example:adb backup -apk com.whatsapp -f whatsapp.ab.
⚠️ Important: On Android 10 and higher without root, the
-apkand-systemparameters may not work for many apps due to changes in system protection. Only their data will be saved (if the app allows it). Root is required for a full APK backup of system apps.
Step 5: Confirm the Backup on the Device
After running the command, a "Back up my data" dialog will appear on the device screen.
- You can set a password to encrypt the backup file (recommended if the file contains sensitive data). Enter the password twice.
- If no password is needed, leave the field blank.
- Tap "Back up my data".
- The copying process will begin. A "Creating backup..." notification may appear on the device.
Step 6: Wait for Completion
- The terminal will display progress as dots (
.) or percentages (depending on the ADB version). - Do not disconnect the device or use it during the backup.
- After completion, the terminal will show
backup finished(or simply return to the command prompt). - The
backup.abfile (or the name you specified) will be created in the current directory (or the specified path). Its size can reach several gigabytes.
Verifying the Result
- Ensure the backup file exists and has a non-zero size:
(Linux/macOS) or check file properties in Windows.ls -lh backup.ab - For integrity checking, try restoring the backup on the same device (see the restore guide). If restoration completes without errors, the backup is valid.
- Store the file in a safe location (external drive, cloud storage). It is recommended to keep it together with the remembered password if you set one.
Potential Issues
Device not listed in adb devices
- Cause: Drivers not installed (Windows) or USB debugging not enabled.
- Solution: Install ADB drivers (can be done via
adb kill-server→adb start-server). For Windows, download drivers from the device manufacturer's site or use universal ones (e.g., from ClockworkMod). Ensure USB debugging is enabled on the device and you have confirmed authorization.
Error backup failed or java.io.IOException: Permission denied
- Cause: On Android 10+ without root, some apps prohibit backing up their data. Also, insufficient space on the device or computer.
- Solution: Try backing up without
-apkand-systemparameters (data only). Free up space on the device and computer. Root is required for a full backup of system apps.
Backup created but file is very small (a few KB)
- Cause: Only metadata was backed up because no apps allowing backup are installed, or key parameters were disabled.
- Solution: Ensure flags
-apk -shared -allare used. Check that the device has data to back up (photos, apps).
Restoring from backup requires a password you did not set
- Cause: Some devices (especially with custom skins) automatically set a default password (often empty). If you did not set one, try leaving the field blank.
- Solution: If that doesn't work, the backup might have been created with a password on another device. Restoration is only possible with the correct password.
ADB errors error: closed or error: device offline
- Cause: Connection interrupted, device entered sleep mode, or authorization was reset.
- Solution: Reconnect the cable, unlock the device, restart ADB (
adb kill-server && adb start-server), and re-confirm authorization on the device.