ADB command doesn't seem to work for backing up user data. Any tips?
Fire 7 2015.
So, just some more details. I have debug/adb turned on in the tablet, which I think I rooted fwiw.
When I type the adb backup command "adb backup -noapk -f backups\2017-09-13BlueFire.adb"
I get "Now unlock your device and confirm the backup operation..."
I tried again today and actually got the prompt to allow the backup, but nothing happened. I get returned almost immediately to the command prompt and have a 0 byte file.
Related
I got my phone unlocked and rooted. I installed CWM than I attempted to S-OFF.
First attempt - realized I had 2 problems.
1) I had HTC Sync Manager Installed
2) MY PC cmd/adb is wonky. It was constantly unable to recognized internal/external command. I checked my enviormental variable path and all that jazz and didn't find no solution. (WIN XP) I tried shift-right clicking on the folder and I do not have that option. I attempted to install a program that does that shift-right click feature and it didn't work. I went to Start>Run>cmd and input the entire path and it didn't work. I tried dragging the platform-tools folder into the cmd and it didn't work, HOWEVER when I dragged the adb.exe file on the cmd it ran.
So I began following the instruction.
a) (((Drag adb.exe into cmd window))) [creating the path/director] devices
[adb deamon server starts than device is found]
b) (((Drag adb.exe into cmd window again))) reboot
[phone reboots]
c) (((Drag adb.exe into cmd again))) wait-for-device push firewater /data/local/tmp
[different results from file not found, error command, wrong syntax, unrecognized batch
I attempted to do the same above with firewater.bin - file not found, doesnt exsist type of error.]
ragequit
ROUND 2
re-read guide and realize I had HTC sync manager installed. So I uninstalled it.
During this go around - it seemed to have gotten worse, multiple errors and headaches, I did click YES to everything during the htc syn unintallation so I might have uninstalled the drivers (it showed it was there, but the installer image looked blanked instead of the typical exe image). But I eventually I managed to push the firewater normally before failing on the adb shell command. I probably have pushed this file into data local tmp MULTIPLE TIMES
ragequit after many attempts
ROUND 3
uninstalled all HTC from my PC, unplugged USB, revoke usb priv, reconnect phone to pc - installed manager, waited 30 min, uninstall only the manager and kept the drivers and this time it looked normal and not a blank image. Had to repeat the same steps as Round 1, constantly moving my adb.exe into the cmd window.
a) (((Drag adb.exe into cmd window))) [creating the path/director] devices
[adb deamon server starts than device is found]
b) (((Drag adb.exe into cmd window again))) reboot
[phone reboots]
c) (((Drag adb.exe into cmd))) wait-for-device push (((drag firewater.file into cmd))) /data/local/tmp
[installed]
[During this time, my phone is going crazy - mounting/dismounting, htc manager trying to install, the stupid sync folder pop up multiple times..... Several times, I just ignored it and tried to continues, other times I wait until it's stable.. but at this point, I am not sure if I ****ed up]
d) (((Drag adb.exe into cmd))) shell
[The command went through but my phone never recieved a shell prompt as I have seen in a youtube video, I continued anyhow]
e) something something m8: [already there after I hit enter from shell command] su
[During, Before and/or After - my phone is still mounting/dismounting sometimes, I have waited patiently at times, and other times, I would try rush through all of this step impatiently, I was in hour 4 at this time, frustrated]
f) su
g) Here is where I had more issues, after SU, sometimes the pre-installed path/command is there for me to input chmod 755, sometimes it goes back to my default C:document.\etc\etc and I would either start from a or attempted to run adb shell, while my phone harassing me with the mount/dismount.
sometimes, I am able to type in chmod 755 /data/loc before I get booted back to the C:docu/etv/etc
other times it goes through fine but does that same ****.
ragequit
Round 9,000 (today)
I was calm, I waited until the mount/dismount stopped and it showed my phone was connected. I've done this 2 ways (htc syn usb mode and mount as disk drive)
I manage to get all the way to the end, typed in "Yes".... WHELP, can not install... T_____T
*epic ragequit*
So now, I am sure, I may have corrupted or dmg my data/local/tmp folder?????
What I am curious now is:
A) Can I do a Factory Reset?? Will I loose my Root and/or re-lock bootloader? Soft-brick?
B) If I can't Factory Reset, what can I do?
C) I also tried to OTA the system update and CWM is tellling me installation abort (no error code)
Also, I ran my Titanium backup to see if that would fix any corruption I may have done during the adb fiasco, attempted to install the OTA and still failed/aborted.
I just want to go back to Factory and use twrp/weaksauce or as I read, use another ROM (forgot whom) to get S-off as it worked for others. I can't Flash the current Sinister/Stock Rom since they are on the new 1.54.651.8 while I am on 1.12.xx.x....
frustrated and ready to ragequit again lol
So, after owning my beautiful Moto X for 1 month, I found that the screen is not nearly as shatter resistant as my old iPhone 4S. After managing to completely shatter it, I called Motorola up for a replacement (which for a customized Pure cost $125) and it was on its way, but before that I needed to get my old data off. Luckily I have unlocked my bootloader and rooted my phone in advance, but i had turned off USB debugging and had a passcode lock. All of the guides for making a full backup assume that you have screen access. After messing around for a few days, I finally managed to make a full backup of my phone. I thought I'd put together this guide for anyone else who has the same issue.
Assumptions
Your bootloader is unlocked and phone rooted (do not try to unlock it now or it will wipe the phone)
Your phone is not encrypted (there's still a way around this which I'll cover but I did not have to use)
You have ADB/fastboot set up on your computer (and have tested it at least once)
Required files/guides
CWM recovery file - http://motoxroot.com/cwmtwrp-recovery-for-moto-x/
Lock Screen removal guide - http://forum.xda-developers.com/showthread.php?t=1409304
SQLite DB editor (I'm on Windows) - http://sqliteadmin.orbmu2k.de/
Androidscrencast - https://code.google.com/p/androidscreencast/
ADB keystroke events - http://thecodeartist.blogspot.com/2011/03/simulating-keyevents-on-android-device.html
Steps
The first thing I did was download the customer CWM image for the 2014 Moto X which can be found here:
Code:
http://motoxroot.com/cwmtwrp-recovery-for-moto-x/
Next I went rebooted the phone into bootloader mode by holding "Volume Down + Power" for about 15 seconds. I could not see images on the screen but I could tell when it lit up.
Note: If you have an encrypted phone, you can use an OTG cable and a standard USB keyboard to type in the password blind. I used something similar for the PIN code, however this guide does not actually need to worry about that
Test that you have fasboot access by running
Code:
fastboot devices
You should see your device listed
Boot the CWM recovery image (you do not have to flash it which is nice)
Code:
fastboot boot XT1095recovery.img
Wait a few seconds and verify that you can now access your phone via ADB
Code:
adb devices -l
If this works, you now have a shell to be able to do the next part which is removing the passcode and enabling USB Debugging I followed the guide at http://forum.xda-developers.com/showthread.php?t=1409304 to do remove the lock screen
Mount the data partition of your phone by running
Code:
adb shell mount data
adb shell mount system
Grab the settings DB from the phone and copy it locally (Other guides say to copy to an intermediary, but since you're using a recovery ROM the files can be directly accessed)
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
Open the file in your SQLite editor of choice and run the following statements
Code:
UPDATE secure SET value=65536 WHERE name='lockscreen.password_type';
UPDATE secure SET value=0 WHERE name='lock_pin_autolock';
While we have the settings DB open, it's also a good time to enable ADB Debugging by running the following statements (credits to http://stackoverflow.com/questions/13326806/enable-usb-debugging-through-clockworkmod-with-adb though I had to mod some more stuff)
Code:
UPDATE global SET value=1 WHERE name='adb_enabled';
UPDATE global SET value=1 WHERE name='development_settings_enabled';
Push the file back to it's original location
Code:
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
From here, the next set of commands should be run within the shell. You can access it by running
Code:
adb shell
Remove some existing property files
Code:
rm /data/property/persist.service.adb.enable
rm /data/property/persist.sys.usb.config
Add in the ADB settings
Code:
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
Correct the permissions for the settings.db file
Code:
chown system:system /data/data/com.android.providers.settings/databases/settings.db
chmod 660 /data/data/com.android.providers.settings/databases/settings.db
At this point, everything is ready to go and we're ready to reboot to your real install with no pin code and ADB enabled.
Reboot your phone
Code:
adb reboot
Run androidscreencast (don't worry about the keyboard/mouse instructions they don't work). Chances are the screen will be blank, press the Power button your phone and wait (it's got a *very* slow refresh rate)
Once you see your desktop, you can now run an ADB backup. I like getting everything, but this will take a while because it grabs all images, music, SD card stuff, etc.
Code:
adb backup -apk -shared -all -f backup.ab
On the screencast you'll see the prompt pop up asking you to enter a password and confirm. This was the part that took me a while and you have to do it fairly quickly otherwise it'll time out. In a separate windows run
Code:
adb shell input text <yourpassword>
adb shell input keyevent 61
adb shell input keyevent 61
adb shell input keyevent 66
At this point, you should see a full backup kicking off and running. You can run a logcat to watch the process of it. In some cases a full backup may hang if a resource has a file open, the two commands to work with this are:
Code:
adb shell logcat | grep BackupManagerService
To kill a process the backup is hanging on, enter the shell
Code:
su
ps | grep <nameOfProcess>
am force_stop <nameOfProcess> (the clean way)
kill <pid> (the dirty way)
Hope this helps! This took me a little while to figure out but now I have a full backup and my new Moto X will be here within the
week.
Okay so an ADB full backup sucks for a restore. Luckily I got a nandroid backup instead and that worked much better. There's some stuff you have to do with mapping /sdcard for it to work on the Moto X. I'll update this post soon with that information.
Thanks a lot for this! Helped me recover all my data from a Moto X with a completely broken blank screen!
This is an awesome Guide! Congrats!! I have a different situation. My Moto X 2014 is the XT1097 variant. The phone was neither rooted nor had an unlocked bootloader before the screen died. I downloaded the stock rom for my device, and flashed it with RSD Lite, since the program sees the phone connected in fastboot mode. Do you think I could use this method to reach the desktop? Also, the recovery.img in your guide is for the XT1095. Would it work for the XT1097? I know I can unlock the bootloader via fastboot, but what about rooting? Thanks in advance!!
I can't get the adb backup interface to show on the phone. adb is working, device is recognized. I've tried both NRT adn from command line (Windows machine)
I'm running the M Dev Preview 3
I don't have any screen changing apps installed, device is not rooted
Any thoughts?
just to give a little more information. I'm running the following adb command
adb backup -apk -shared -all -f C:\temp\Nexus6_2015-10-5.ab
It tells me to unlock the phone and confirm but nothing shows up on the phone
adb devices shows the device
adb reboot will reboot the phone
makes me think adb is working
Figured it out
Downloaded the SDK via android studio and ran it that way instead of through the WugFresh directory
Hello all, I think this is going to be easily answered here as I can't find the answer anywhere else.
I am trying to use ADB to pull the entire contents of /sdcard/
Ive been typing the following commands
adb root
adb shell
adb pull -p /sdcard/ C:\Users\
after typing the pull command I just end up at a '>' prompt and nothing happens.
I'm using a Win 10 machine, CMD running as admin. My phone is I9305, rooted running CM 12.1, debugging is enabled and I have even installed ADBD insecure.
I have been doing all this with the device booted.
What obvious mistake am I making?
Is your device getting detected in command prompt by typing "adb devices"?
My issue was fixed after EFS repaired and ADB starts detecting my phone
My display is broken, i can't see anything on my Mi9T pro.
But i can boot blind into recovery or system, enter the pin via an USB-keyboard and then browse my files on my computer. I can also find the phone with adb.
Is there any chance to get my app data from the phone? Can i backup my app data without using the screen? Or even a chance to browse it? Or can i see my screen via usb?
I have titanium backup on my phone, can i make a backup without seeing it? And then get the files via mtp to my computer?
I'm on the latest xiaomi.eu release (from second august-week).
If you have enabled usb debugging then try scrcpy.
sagar29 said:
If you have enabled usb debugging then try scrcpy.
Click to expand...
Click to collapse
I get:
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1
Press any key to continue...
Does that mean, that USB-debugging is not enabled? But i can access internal storage and find the device via adb.
Edit: I can find it in ADB when i'm in recovery. After entering the pin, i can also access data in recovery. When i am in OS and entered the pin, i can access the storage.
if you can access your storage from adb then copy your data to your pc.
sagar29 said:
if you can access your storage from adb then copy your data to your pc.
Click to expand...
Click to collapse
When i get an answer with "adb devices", then i am connected. What should i enter next?
McFlypants said:
When i get an answer with "adb devices", then i am connected. What should i enter next?
Click to expand...
Click to collapse
if you want to backup data in your internal storage then type "adb pull sdcard/Android"
if you want to backup data partition then type "adb backup --twrp data" it will create a backup.ab file, you cannot browse this file you can only restore.
you can also copy appdata from data patrition like this "adb pull /data/app"
you can browse folders like this
adb shell
cd data
ls
sagar29 said:
if you want to backup data partition then type "adb backup --twrp data" it will create a backup.ab file, you cannot browse this file you can only restore.
Click to expand...
Click to collapse
This is not working because i have to unlock my phone for that - what i can't do because i can't use the screen. When i disconnect the usb-connection to connect the usb-keyboard, adb closes.
sagar29 said:
you can also copy appdata from data patrition like this "adb pull /data/app"
Click to expand...
Click to collapse
That works, i will try to restore the needed app data on my new phone!
Thanks!!