I need help from you guys, because I don't know what I did wrong with adb backup.
I want to backup my Samsung Galaxy S3 LTE (GT-I9305) without root. I googled it and found Full Android Backup with SDK Manager. I installed all i need for this like Java Development Kit 8 version 66 (JDK 8u66 x64) and Android Studio which contains SDK Manager. Then they sad i should download the Google USB Driver. I downloaded it but nothing happened. I thought it should work now and then I went to C:\Users\MYNAME\AppData\Local\Android\sdk\platform-tools and left-clicked adb whilst holding Shift. Then I clicked "Open command window here". After this I typed in "adb devices" and it said:
List of devices attached
3204cfaaf8611199 device
Then I typed in:
adb backup -apk -shared -all -f C:\Users\NAME\backup.ab
It said
Now unlock your device and confirm the backup operation.
I did this and my Smartphone opened "Full Backup" and then I was able to set a password for the backup. I don`t need a password and I just clicked "Back up my data" Then it went back to my homescreen and said "Starting backup..." as a toast message and immediately after this it said "Backup finished" and created a backup file with 40 bytes. I don't know what I should do now.
The problem is the adb version of your PC. Using adb version 1.0.31 the backup/restore will be sucessfull.
More info on: https://android.stackexchange.com/questions/83080/adb-backup-creates-0-byte-file-prompts-for-current-backup-password-even-though and How to downgrade my SDK Version?
Rather than trying to find an old version of adb, it's easier to add quotes to the arguments to adb backup :
Just incase anyone is still having trouble - In windows, I found putting the quotes around only the directory, for example "C:\Users\NAME\backup.ab" worked.
This just worked using Ubuntu 15.10 ("wily") to backup a Galaxy SM-G900V running Android version 6.0.1.
Installed using:
sudo apt-get install android-tools-adb
Then I ran the following from the command line (without 'sudo'):
adb backup -apk -shared -all -f backup.adb
Result:
Thank you "NG". I was beginning to think my phone was borked.
Forgot to add: Running adb version: Android Debug Bridge version 1.0.31
The line, which correctly invokes
adb
, needs to look like this at my side:This line is for Linux, but should do for Windows and OS-X as well. For Linux (and probably OS-X), you can use a script like following, which automatically assigns a timestamp to the file:
FYI
I post this update, as all other answers were helpful, but not exact to the last detail. (When used with full quotes, a backup was done, but called
backup.ab
)Here is my environment:
The full procedure was (just in case somebody stumbles upon this not knowing what is needed):
adb
(on Ubuntu:sudo apt-get install android-tools-adb
)adb devices
- you should see something likeXXXXXXXXXXXX unauthorized
OK
. First move the obstructing window.adb devices
- you should see something likeXXXXXXXXXXXX device
ANDROID_SERIAL=XXXXXXXXXXXX
.)Now run
adb backup
as shown above. Change the file to your needs.Notes:
adb help
shows all possible options toadb backup
Apparently
adb backup
does not completely backup everything!I had a look into the backup (
cd X && dd if=../XXXX.adb bs=24 skip=1 | zlib-flate -uncompress | tar xf -
) and did not find all installed applications.What I was able to find was (note that this list is incomplete):
shared/0
shared/1
apps/
- many apps (like Google Authenticator) were missingapps/com.android.providers.calendar/db/calendar.db
(probably)What I was not able to find (note that this list is incomplete):
share/1
. For example the apps, which are moved-to-SD.)Conclusions:
adb backup
might create corrupt backups, which can go unnoticed. So either check your backup or do frequent backups and pretend to be lucky enough such that not all backups go corrupt.adb backup
you get a backup of most of your precious data, like camera images and so on. It might be a bit difficult to unpack it, though.adb backup
is not enough to do a complete backup of your phone.adb backup
is not enough to backup your SD-card such, that if it breaks, you are able to replace it by a new one with the contents restored. This is very sad!PS: The typo "Forth" is not an accidental one.
PPS:
zlib-flate
can be found in packageqpdf
on Ubuntu 18.04Seem not all apps can be backed up. Android apparently allow apps to disable backup :(
https://developer.android.com/guide/topics/manifest/application-element.html (search for allowbackup)