using adb to backup user apps on googleglass - Glass General

I found the following steps useful and thought I should document it for the benefit of others. I did not know that adb has a backup which is useful for non-rooted devices like the google glass where you do not have direct access to /data/app folder via adb shell.
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any installed apk expansion
(aka .obb) files associated with each application; the default
is noobb.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
I used "adb backup -nosystem -apk -all -f backup.ab" to backup all my apps
You can then use http://sourceforge.net/projects/adbextractor/ to validate the integrity of the backup
[email protected]:~/android-backup-extractor-20130526-bin$ java -jar abe.jar info
Android backup extractor
Cipher.getMaxAllowedKeyLength("AES") = 128
Strong AES encryption disabled, MaxKeyLenght is < 256
Please install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
Usage:
info: abe info <backup.ab> [password]
unpack: abe unpack <backup.ab> <backup.tar> [password]
pack: abe pack <backup.tar> <backup.ab> [password]
Works like a champ!
Hope this helps someone like me who did not know about adb backup prior to now.

It is interesting that on an un-rooted XE12 glass, one can access directly all the system apks that are located under /data/system but not directly access the manually loaded app apks located under /data/apps
All of these succeed
adb pull /system/app/ApplicationsProvider.apk
adb pull /system/app/BackupRestoreConfirmation.apk
adb pull /system/app/CalendarProvider.apk
adb pull /system/app/CertInstaller.apk
adb pull /system/app/ContactsProvider.apk
adb pull /system/app/DefaultContainerService.apk
adb pull /system/app/DownloadProvider.apk
adb pull /system/app/FrameworkStubs.apk
adb pull /system/app/GlassBluetooth.apk
adb pull /system/app/GlassBoutique.apk
adb pull /system/app/GlassBrowser.apk
adb pull /system/app/GlassCamera.apk
adb pull /system/app/GlassDeviceAdministration.apk
adb pull /system/app/GlassGesture.apk
adb pull /system/app/GlassHangouts.apk
adb pull /system/app/GlassHome.apk
adb pull /system/app/GlassLockRecovery.apk
adb pull /system/app/GlassLogging.apk
adb pull /system/app/GlassMaps.apk
adb pull /system/app/GlassMusicPlayer.apk
adb pull /system/app/GlassPhone.apk
adb pull /system/app/GlassPhotosphere.apk
adb pull /system/app/GlassSearch.apk
adb pull /system/app/GlassSettings.apk
adb pull /system/app/GlassSetup.apk
adb pull /system/app/GlassSound.apk
adb pull /system/app/GlassSystemUI.apk
adb pull /system/app/GlassTutorial.apk
adb pull /system/app/GlassUpdate.apk
adb pull /system/app/GlassVideoPlayer.apk
adb pull /system/app/GlassVoice.apk
adb pull /system/app/GoogleBackupTransport.apk
adb pull /system/app/GoogleLoginService.apk
adb pull /system/app/GoogleServicesFramework.apk
adb pull /system/app/GoogleTTS.apk
adb pull /system/app/KeyChain.apk
adb pull /system/app/LatinIME.apk
adb pull /system/app/MediaProvider.apk
adb pull /system/app/NetworkLocation.apk
adb pull /system/app/PackageInstaller.apk
adb pull /system/app/SettingsProvider.apk
adb pull /system/app/SystemUI.apk
adb pull /system/app/UserDictionaryProvider.apk
adb pull /system/app/VpnDialogs.apk
adb pull /system/framework/framework-res.apk
adb pull /system/framework/glass-framework-res.apk

I can't for the life of me select any of the options. If I reboot Glass, run the command, I can highlight the "Do not backup" button by tapping the side of Glass once. But there is no way to swipe over to "Backup my data". Any pointers?

Related

Adb commands for beginners

ADB COMMANDS
This is just a simple guide on how to open up and run adb commands from your windows based operating system.
Open up run by simultaneously pressing the windows flag key and r.
In the window that pops up type cmd. Now command prompt is open
type the commands each followed by the enter key: cd\
cd androidsdk/tools
Now your in your in your androidsdk/tools folder. You can do several things in here but i'll start with some basics each
of the following commands is to be followed by the enter key
adb devices (this lets you know what devices are attached to the computer in usbdebugging)
How to get your logcat (this will put your logcat in txt format in your sdk tools folder)
adb logcat > logcat.txt
copy an app from your phone to your computer
adb pull /system/app/whatever.apk C:\ateam (replace whatever.apk with the app your pulling also replace ateam with the
folder your placing the app in
Install an app from your computer on your phone
adb install whatever.apk (put an apk in your sdk tools and replace"whatever" with the name of the apk and it will install it)
also you can add either -r or -s to reinstall or install on the sdcard for instance: adb install -r Rosie.apk
this command will reinstall the new rosie from your tools file and still keep the same user data as before.
-r for reinstall
-s for sdcard (gotta test this)
Push an app from your computer to your phones filesystem (in some cases also installs)
adb remount
adb push whatever.apk /system/app (put an apk in your sdk tools and replace "whatever" with the name of the apk and this
will push it to your system app folder. You can change the destination as well for example: You want to push Launcher2.apk
to your data/app folder: adb remount
adb push Launcher2.apk /data/app )
Remove an app from your phone
adb remount
adb shell
cd /system/app (this will change your disk to system/app you may also change to another folder as well)
ls -a ( a list will show of all the apps inside your system app folder)
rm whatever.* (replace the whatever.* with the name of a apk you want to remove )
Flash a recovery image to your phone
First pace the recovery image in your sdcard root and rename it to recovery (so the full name will now be recovery.img)
adb shell
flash_image recovery /sdcard/recovery.img (wait till this# sign shows up again before you type the next command)
reboot recovery
get your current battery level
adb shell cat /sys/class/power_supply/battery/capacity
get your current rom build
adb shell getprop ro.build.description
Reboot into fastboot ruu
adb shell reboot oem-78
How to run the ruu via adb
First thing first start the ruu give it permissions and so fourth
When it gets to the part where it says "Follow the instructons below..."
Move the ruu window out of the way and start your task manager
Go to processes right click on ARUWizard.exe and choose open file location
A new window will open scroll till you see ROM.zip
Copy and paste Rom.zip to your desktop
Once you have copied it to your desktop shutdown the ruu and task manager
Click start menu then click computer
A window will open up click the c drive
now click create new folder and name it test
put the rom.zip in the test folder
plug your phone in and open command prompt and type
Code:
adb devices
adb shell reboot oem-78
fastboot devices
fastboot getvar boot-mode
fastboot erase cache
fastboot flashzip C:\test\rom.zip
fastboot devices
fastboot getvar boot-mode
fastboot reboot
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
sandboxlove said:
i think its a great idea, we need a more compilied list to refer to
add more!!!!
Click to expand...
Click to collapse
I'm going to try to add one everyday. tomorrows lesson how to run the ruu from adb
Powers16 said:
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
Click to expand...
Click to collapse
Where? Pagelink
http://forum.xda-developers.com/showthread.php?p=5799939#post5799939
but its a less in depth reference so i hope this gets added into the tutorial section as here are no in depth tuts about adb in there..
also to remove apk
adb shell rm /system/ (then put in either app or media or what ever folder name /whatever.apk
Papa Smurf151 said:
also to remove apk
adb shell rm -r /system/ (then put in either app or media or what ever folder name /whatever.apk
Click to expand...
Click to collapse
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
This is great, I will be coming back for more.
Thanks a lot
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
thanks...i knew that but wasnt paying attention. I just copied and pasted from my adb notepad file. i edited my post and removed the -r
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
LOL, yeah, I've done that
Might want to also include a note that says when using linux or mac shell you replace the "adb" with "./adb" (I believe that is correct or at least what I do now when reading the windows cmd guides)
tejasrichard said:
LOL, yeah, I've done that
Click to expand...
Click to collapse
I wiped out 16 years of source code with it once....I got fired.
Kcarpenter said:
I wiped out 16 years of source code with it once....I got fired.
Click to expand...
Click to collapse
Oh damn that's crucial man. Hope they had backups
Screwin around
So I was screwin around with adb tryin to learn this stuff and I stumbled across this by just typing adb after cd'ing in. Hopefully its useful. Mind you I am a total noob to android/linux and this was a total accident. I am sure you all know about it though. Useful info though
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>cd\
C:\>cd android-sdk-windows
C:\android-sdk-windows>adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device.
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must be an
absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloade or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
C:\android-sdk-windows>
Hi, I'm abcdfv, and I approve this thread.
abcdfv said:
Hi, I'm abcdfv, and I approve this thread.
Click to expand...
Click to collapse
LOL Thanks
I've always been an advocator of EVERYONE learning the ADB basics at least.
updated with run the run the ruu via adb commands
I'm trying to flash my recovery image. I need help. What is the first comand I type at C:\Windows\System32> normally I type cd:\android-sdk-windows\tools
then i adb remount, then adb shell. When I do that now I get "remount failed: Invalid argument" I'm not TOTALLY clueless, although it may turn out that I am after this. any help would be great. I am booted in recovery, but since my recovery image is gone, its just an exclamation in a triangle. if i adb devices, i can see my phone and it says i'm in recovery. Thanks.
I need some serious help with this.....do you need to download anything on your computer?? can you explain all the stuff you need to do leading up to what you type into command prompt...anyone..i need help..i flashed darchstar froyo build and the recovery is all messed up..i cant flash anything..so i need to push a new recovery img.but i don't know anything about adb shell or anything .....please........ive never had to push anything..everyone always just puts flashable zips out for you...HELP

[How To] Enable Non-Market apps on Captivate (consolidated)

(additional CHOWN notes added below. If you are getting "chown: unknown user/group system:system" read them!
Ok, we do have a WHOLE other thread that was made a sticky already, but you need to read the WHOLE thing to get all the properly interesting parts. I'll make sure I keep this OP up to date.
The following methods enable side loading and installing of apps onto the captivate, without the need of a program on a computer attached via the SDK. There are multiple methods, and for the most part, these methods that have worked flawlessly for many users here on this forum. We're just collecting them all in one post for speed and clarity.
Methods that assist in loading applications, without modification to the settings (a.k.a still need a computer attached) can be found at the collective wiki, http://samsungcaptivate.wikia.com/wiki/How_to_Sideload
ALL METHODS REQUIRE ROOT & BUSYBOX:
Root your phone, see http://forum.xda-developers.com/showthread.php?t=725555
Busybox : http://www.appbrain.com/app/stericson.busybox
Please, save a clean, un-altered backup copy of this file. To be safe. Rarely does corruption occur, but if it does, it won't be good.
Method 1: From Win7x64, Samsung Drivers, Android SDK installed.
This method uses the tools you already have at hand, as part of the SDK. All instances in code blocks are run inside of the command prompt. You will need to know where you installed your SDK, and the tools directory therein.
Once rooted, go install BusyBox installer from the App Market/AppBrain etc and run it. It will download and install the latest version for you.
From my Win7x64, with USB Debugging ON. Ensure that you phone is UNLOCKED as it the SU app will ask for permission for 'UNKOWN' in the following command.
Connect to PC, and Eject/Safely Remove the SD card, and "Turn off USB Storage" on the phone.
open command prompt, follow along:
Code:
> c:
> cd \android\tools
> adb shell
$ su
# cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
# exit
$ exit
mount the SD cards to the pc,
"USB Connected select to... ", Mount
mine mounted as H:
Code:
> copy H:\settings.db settings.db
> sqlite3 settings.db
~> update secure set value="1" where name="install_non_market_apps";
1 row updated
~> .quit
> copy settings.db H:\settings.db
Eject the drive, safely remove, etc.
"Turn off USB storage" etc, to mount it back to the phone
Code:
> adb shell
$ su
# cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> adb reboot
Bam. Done.
Method 2: with Root Explorer
(courtesy of kirbo20)
This is a pretty easy process. I went in to Root Explorer - dbdata - databases - com.android.providers.settings, copied settings.db to my sd card, edited it on my pc with a db editor changed 0 to a 1 next to non market apps. Copied it back to the original directory, rebooted and installed a non market app.
(added by gotfolk)
again using FF plug in..
Click Secure on the left pane
click on install_non_market_apps
click edit
number 3 states value click there and type in 1. hit ok
(/gotfolk)
Please use caution. If you want to make sure the db save properly open it on your sd card before you copy and replace the original. It should open up as a readable table. If it opens up in a txt editor its corrupt. This permanently enables non market apps. You can not toggle it on and off.
( This is a sqlite3 database file, you can find many GUI editors that will be able to handle the editing, including a FF plugin. Search "SQLite" )
Method 3: with Root Explorer & Sqlite Editor & Terminal Emulator
(courtesy of ice3186)
- Open Root Explorer
- Browse to /dbdata/databases/com.android.providers.settings/
- copy settings.db to the root of your sd card ( /sdcard/ )
- Click on the newly copied settings.db in /sdcard/, with SQLite Editor installed, you can open and edit it here.
- Select the "secure" table, and update the value of 'install_nonmarket_apps' from 0 to 1, and save.
- close out of SQLite editor
- copy the modified file ( /sdcard/settings.db ), and browse back to /dbdata/databases/com.android.providers.settings/ and paste
- confirm the overwrite if asked and then open again to confirm it's been changed.
- open Terminal Emulator
Code:
$ su
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# reboot
- reboot phone.
No PC, no Mac, no drivers, no SDK. Viola.
Method 4: Mac & Android SDK
You will see "[sdcard]" through this method...I don't own a Mac so I'm guessing a bit.
This method uses the tools you already have at hand, as part of the SDK. All instances in code blocks are run inside of the Terminal. You will need to know where you installed your SDK, and the tools directory therein.
Once rooted, go install BusyBox installer from the App Market/AppDroid etc and run it. It will download and install the latest version for you.
From a Max OS X, with USB Debugging ON. Ensure that you phone is UNLOCKED as it the SU app will ask for permission for 'UNKOWN' in the following command.
Connect to Mac, and Eject/Safely Remove the SD card, and "Turn off USB Storage" on the phone.
open Terminal, follow along:
Code:
> cd /android/tools
> ./adb shell
$ su
# cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
# exit
$ exit
mount the SD cards to the Mac,
"USB Connected select to... ", Mount
mine mounted as [sdcard]
Code:
> cp [sdcard]/settings.db settings.db
> ./sqlite3 settings.db
~> update secure set value="1" where name="install_non_market_apps";
1 row updated
~> .quit
> cp settings.db [sdcard]/settings.db
Eject the drive, safely remove, etc.
"Turn off USB storage" etc, to mount it back to the phone
Code:
> ./adb shell
$ su
# cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> ./adb reboot
Method 5: Android SDK only
Of course, this also requires root and BusyBox.
From the android sdk tools folder in a command prompt:
note: all linux/mac should use './adb' in place of just 'adb', and place quotes on the echo statement between echo and |
Code:
adb shell
su
chmod 666 /dbdata/databases/com.android.providers.settings/settings.db
exit
exit
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
echo update secure set value = 1 where name = 'install_non_market_apps';|sqlite3 settings.db
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
adb shell
su
chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
chown system.system /dbdata/databases/com.android.providers.settings/settings.db
reboot
NOTICE
You must chown the settings.db file and reboot once it is back in its original location. If you do not, you will not be able to alter settings such as WiFi,GPS, default Ringtones, etc. It's also highly likely that you may wish to chmod to 660 (-rw-rw---), so I've tacked that in here and above.
Code:
> adb shell
$ su
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> adb reboot
Chown Note
In the event that you are getting "chown: unknown user/group system:system" please try 1000.1000 as this has been reported to work on several of the samfirmware-released roms that fail with this message.
Absolutely do not use someone else's settings.db unless you specifially make it a point replace android_id with your android_id!
Special Note
Any of these adb comments can be run from Terminal Emulator (Android Terminal Emulator, free) from the su command. I use the ADB here as it is a lot easier to type into. Terminal Emulator will provide you with a shell that is an exact match of the 'adb shell' command, as they both simply provide the shell to you.
Result:
After completing this process you will be able to load non-market apps directly from the APK files, SDK tools, tools such as DroidExplorer and apps such as APKtor.
You will be able to download the APKs directly, and then install from your favorite file browser (e.g. MyFiles(s), Astro(f), RootExplorer($)...)
Tools
SQLite Administrator (Win, GUI, no FF required) http://sqliteadmin.orbmu2k.de/
SQLite Manager (FF addon, search for it)
Application links
Root Explorer http://www.appbrain.com/app/com.speedsoftware.rootexplorer
SQLite Editor http://www.appbrain.com/app/com.speedsoftware.sqleditor
Terminal Emulator http://www.appbrain.com/app/jackpal.androidterm
BusyBox http://www.appbrain.com/app/stericson.busybox
bump.. settings.db people.. please read the threads!!
good stuff!!!
Ok. I can find settings.db with root explorer. i can copy it and i put it in my sdcard folder but nothing is there when i try to find it on my computer. Im trying to use SQlite editor on firefox. Im also on a powermac g4 if that makes a difference. I did download sqlite editor on my phone and I can find where to change the values for installing non market apps but when I change from a zero to a one it denies me. Please help
Ok, so let me make sure I have your process:
- Rooted
- Installed busybox ?
- Installed Root Explorer
- copied settings.db to /sdcard
-- cant see the file when mounted to Mac, thus can't edit with FF plugin
-- SQLite editor for android wont allow access..
(is this the SQLite Editor you used? http://www.appbrain.com/app/com.speedsoftware.sqleditor)
Try installing "Android Terminal Emulator" from the market (http://www.appbrain.com/app/jackpal.androidterm)
- open Terminal Emulator
$ su
# cd /sdcard
# chmod 777 settings.db
# exit
- Open the sqlite editor, and make the change
- back to Terminal Emulator
$ su
# chmod 660 settings.db
- proceed with rest of instructions.
how many more threads do we need on the same thing? We already have ALL of this info posted, several times.
designgears said:
how many more threads do we need on the same thing? We already have ALL of this info posted, several times.
Click to expand...
Click to collapse
Please read my initial post, first few lines. I explained why, specifically: Consolidation.
Thanks I will give it a try later today.
Sent from my SAMSUNG-SGH-I897 using XDA App
- OP updated to reflect stock ownership settings for 'chown'
Also, which sqlite app are you using? I'll put that up as method 3 if it works out nicely for you.
fixed a typo in the chown command.. bad copy paste.. bad.. doh.
added method 3 courtest of ice3186
added links to Root Explorer ($), SQLite Editor ($) and Android Terminal Emulator (free) and added the chmod/chown commands to method 3, as they were skipped by accident.
bump** for newcomers, sry.
thanks max for adding the third method. this was by far much easier than the first two methods. I have a hard time getting my mac to talk to my phone sometimes and it was good to not have to plug the lil guy in at all. Worked like a charm
myself and ice3186 are glad we could be of help
If I had accidentally deleted the settings.db how should I go about recovering my phone? Now I have the issue that my phone won't boot past the boot animation and I'm notbsure what to do
mkslt4 said:
If I had accidentally deleted the settings.db how should I go about recovering my phone? Now I have the issue that my phone won't boot past the boot animation and I'm notbsure what to do
Click to expand...
Click to collapse
Did you make any kind of backup before hand?
You may have to use someone else's settings.db and then do a factory reset.
Depending on how much you've done with the phone I'd suggest deciding on doing a the reboot process for rooting, but choosing to clear data. This may rebuild it, I am not sure.
my dbdata directory is empty.. My phone is less then 2 hours old and i have some market apps installed..
xetrev said:
my dbdata directory is empty.. My phone is less then 2 hours old and i have some market apps installed..
Click to expand...
Click to collapse
Oh, if it's running, then this folder isn't actually empty.
What are you using to browse this folder?
i followed this guide to a T yesterday when i did this. I used option 1, ADB commands on terminal since i'm a mac and it was super easy, did it in about 5 minutes.
this is just my opinion but i think everyone should try playing with the ADB commands, they're actually really useful and educational to know. and if you should brick your phone, just use clockwork recovery to restore it.
that being said, maybe you should add a disclaimer that when done on a mac, the adb commands require a "./" in front (so adb reboot becomes ./adb reboot). cp, chown, and chmod commands don't need it though (or at least i didn't).

[Q] Permissions problem using adb to push app

I'm running a script to modify settings.db (found in the application forum) so that I can wirelessly tether and use the GPS on my phone while running Google Maps on the KF.
The script starts like this:
adb shell rm /data/local/tmp/*
adb push zergRush /data/local/tmp
adb shell chmod 755 /data/local/tmp/zergRush
adb shell ./data/local/tmp/zergRush
Click to expand...
Click to collapse
and works fine.
But I'm having problems running the script that others are having no problem with at this point in the script.
adb pull /data/data/com.android.providers.settings/databases/settings.db
copy settings.db settings.bak
sqlite3 settings.db "update secure set value=1 where name='mock_location';"
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
adb reboot
Click to expand...
Click to collapse
The script runs into permission errors. I have all the files in the same directory as adb in the platform-tools folder. adb is communicating with the device with the adb devices command. I run the .bat file from the folder while in a DOS command shell. And I get this error
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb pull /data/data/com.android.providers.settings/databases/settings.db
failed to copy '/data/data/com.android.providers.settings/databases/settings.db' to './settings.db': Permission denied
C:\Program Files (x86)\Android\android-sdk\platform-tools>copy settings.db settings.bak
The system cannot find the file specified.
C:\Program Files (x86)\Android\android-sdk\platform-tools>sqlite3 settings.db "update secure set value=1 where name='mock_location';"
Error: no such table: secure
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
failed to copy 'settings.db' to '/data/data/com.android.providers.settings/databases/settings.db': Permission denied
Click to expand...
Click to collapse
Any idea what's going on?
i assume you'r at the $ prompt - if you type in su the prompt should change to #
perhaps a hint in the right direction ...
zergrush does'nt work anymore since 6.2.1 and burritoroot
I am not at any command prompt when running the script. I'm at the Windows prompt, and I just execute the script name?
Confused.
when you type adb or adb shell your mostly at the $ prompt
when you type su the promt usually changes to # - thats root access
i think you have to integrate that in your script ...
I added
adb shell su
to the start of my script, but then it just hangs at the root prompt.
if you have rooted with burritoroot try "adb root"
It says:
adbd cannot run as root in production builds
ok then i think you will have to try it with the su method - maybe "adb su" could work - it's just a try
otherwise i think you will have to write a second unix stile script (ending .sh) to do the stuff and call it from your dos script or run it in the adn shell - but i'm not the unix expert - sorry
i'm running out of time now - wish you much luck with your script !!!
Anyone else please?
Resolved.….
Resolved how? Very curious
Please, how did you solved the problem ???
thanks
would be interested too !
Here's how.
I was so frustrated, didn't seem to be able to achieve root status and use ADB. So, I bought root explorer, went to directory where settings.db file was, and copied it to sdcard folder on the KF. Then brought it over to my PC just over the USB connection (KF was a Windows drive).
In Windows, ran the part of the script that replaces the "0" with a "1". Then copied it back to the sdcard folder on the device, and used root explorer to move it back to its proper directory.
Only one caution. Make sure that you don't change the permissions or ownerships of the file, that they are the same as when you first grabbed it.

[Q] Best Backup Solution for ROOTED but LOCKED Nexus 7

Hello Everyone,
I recently Rooted my Nexus 7, but did not Unlock it because as I understand it......Unlocking will wipe my data.
I have tried many backup solutions and I find TWRP to be by far the best, but there is one catch and it's bugging me.
TWRP doesn't backup everything. For example "Internal Storage" aka "SDCARD" aka what ever else android calls the directory to be more confusing lol
I have been trying different things to backup what TWRP doesn't cover and it has just been a long frustrating failure.
MTP is terrible. It can't really be trusted and Windows Explorer becomes unresponsive. It worked better when I selected a few folders at a time but still horrible to trust. However I am open to any suggestions.....maybe there is an MTP Client that is better at handling this than Windows Explorer? I don't know.
ADB Kinda sorta doesn't seem to work with a locked device. Although Holo backup which uses ADB seemed to save a lot to a backup file, it didn't work to restore from it. Even tried unzipping it to see what was in that file but no luck. So I don't know if this means ADB is also hopeless or not.
Airdroid / Wifi File Transfer app also don't work very well with certain directories or major transfer sizes.
Any suggestions would be greatly appreciated. I would really like to be able to do the unthinkable which is recover from a Hard Factory Reset, but I am fine with just being able to save a backup of everything that TWRP won't.
Thanks so much in advance.
External USB and Titanium Backup. You can order a cable to use an external usb on amazon for about a dollar.
What about uploading to cloud storage? Dropbox, drive, etc. Might not work so good for large files though.
Sent from XDA app
Not sure why you created another thread on this issue, but what doesn't work with adb? Adb pull /sdcard will pull everything from your sdcard including your twrp backup.
Adb doesn't care if you have a locked boot loader.
Sent from my Galaxy Nexus
KingVeto said:
External USB and Titanium Backup. You can order a cable to use an external usb on amazon for about a dollar.
Click to expand...
Click to collapse
Thanks I already have one and I been using it for the things I tried above. Mine is just a small adapter no cord.
gc84245 said:
What about uploading to cloud storage? Dropbox, drive, etc. Might not work so good for large files though.
Click to expand...
Click to collapse
That would be ok but as you said not so good for large files. plus i would prefer an offline backup solution to toss on my NAS as well.
Pirateghost said:
Not sure why you created another thread on this issue, but what doesn't work with adb? Adb pull /sdcard will pull everything from your sdcard including your twrp backup.
Adb doesn't care if you have a locked boot loader.
Click to expand...
Click to collapse
Honestly it beats me why I can't get ADB to work. Only reason why I though it was related to my bootloader being locked was because some programs / toolkits I used brought up an error saying that it couldnt connect adb due to locked bootloader.
I can't get ADB working and it has been driving me mad lol. I feel like maybe I am doing something stupid wrong when trying to use an adb command.
At this point I would love a noob guide with screen shots on how to use adb command, the adb command line tool....the works on adb lol.
Screenshots would be a huge help to prove that I am not doing something dumb and that I actually have some issue with adb.
Thanks Everyone.
Code:
C:\Users\pirateghost>adb
Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <specific device> - directs command to the device or emulator with the given
serial number or qualifier. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
Code:
c:\temp\gnex>adb pull /sdcard
Using your example except for the directory names being different this is what I would get:
(I am using the names of your directories for simplicity....I know enough that mine would vary lol)
After running adb and entering the command as you did. This is the outcome:
'adb' is not recognized as an internal or external command, operable program, or batch file.
HandyAndyXDA said:
Using your example except for the directory names being different this is what I would get:
(I am using the names of your directories for simplicity....I know enough that mine would vary lol)
After running adb and entering the command as you did. This is the outcome:
'adb' is not recognized as an internal or external command, operable program, or batch file.
Click to expand...
Click to collapse
because you have not set adb to be an environment variable.
browse to where your adb.exe is located
make a new directory called n7
hold down shift and right click in the box somewhere in windows explorer
click on open command window here
then type this:
Code:
adb pull /data/media n7/
/data/media and /sdcard are the same location
Pirateghost said:
because you have not set adb to be an environment variable.
browse to where your adb.exe is located
make a new directory called n7
hold down shift and right click in the box somewhere in windows explorer
click on open command window here
then type this:
Code:
adb pull /data/media n7/
/data/media and /sdcard are the same location
Click to expand...
Click to collapse
OK, did that which made perfect sense.
This is what it outputs:
pull: building file list...
0 files pulled. 0 files skipped.
(That was trying it with /media n7/)
The following is when i tried it with /sdcard:
remote object '/sdcard' not a file or directory
HandyAndyXDA said:
OK, did that which made perfect sense.
This is what it outputs:
pull: building file list...
0 files pulled. 0 files skipped.
(That was trying it with /media n7/)
The following is when i tried it with /sdcard:
remote object '/sdcard' not a file or directory
Click to expand...
Click to collapse
/data/media
/data is the partition, media is the directory
/media is looking for a media directory on the root or /
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Pirateghost said:
/data/media
/data is the partition, media is the directory
/media is looking for a media directory on the root or /
Click to expand...
Click to collapse
I appreciate you're patience with me and the help.
Do I need to do some connect command before doing any of that?
HandyAndyXDA said:
I appreciate you're patience with me and the help.
Do I need to do some connect command before doing any of that?
Click to expand...
Click to collapse
no. the command is simply
adb pull /data/media /nameoffolderyouwanttosenditto
GedBlake said:
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Click to expand...
Click to collapse
I agree with the first part but I would like to understand and get ADB going and give it a try myself.
As for the "crippled by lack of removable storage" ..........if you are rooted you can use an adapter to go from the usb port on the nexus to a regular USB port then you can use usb flash drives or any kind of usb storage / card reader whatever. You will need to be rooted / have that adapter / and install an app like StickMount so the device can see the drive and mount it as a directory. This works great.
Thanks
Pirateghost said:
no. the command is simply
adb pull /data/media /nameoffolderyouwanttosenditto
Click to expand...
Click to collapse
This should work but instead right away it outputs this:
pull: building file list...
0 files pulled. 0 files skipped.
GedBlake said:
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Click to expand...
Click to collapse
Sorry I was replying quick and misunderstood.......yes an actual sdcard would not be something I'd say no to. What would be good too is if you didnt have to use either MTP or PTP.....if it just showed up as a drive
HandyAndyXDA said:
I agree with the first part but I would like to understand and get ADB going and give it a try myself.
As for the "crippled by lack of removable storage" ..........if you are rooted you can use an adapter to go from the usb port on the nexus to a regular USB port then you can use usb flash drives or any kind of usb storage / card reader whatever. You will need to be rooted / have that adapter / and install an app like StickMount so the device can see the drive and mount it as a directory. This works great.
Thanks
Click to expand...
Click to collapse
Oh, don't get me wrong - I wasn't trying to dissuade you from using and understanding ADB... and you should give it a try. Definitely. Both Fastboot and ADB are powerful and useful tools, and IMHO you should learn everything you can about them.
I was just grumbling about the data transfer speeds from N7 to laptop...
HandyAndyXDA said:
...if it just showed up as a drive
Click to expand...
Click to collapse
Yes,Yes,Yes... and thrice times YES!.
Rgrds,
Ged.
GedBlake said:
Oh, don't get me wrong - I wasn't trying to dissuade you from using and understanding ADB... and you should give it a try. Definitely. Both Fastboot and ADB are powerful and useful tools, and IMHO you should learn everything you can about them.
I was just grumbling about the data transfer speeds from N7 to laptop...
Yes,Yes,Yes... and thrice times YES!.
Rgrds,
Ged.
Click to expand...
Click to collapse
I understand and agree completely. And, yes i would love to learn as much as i can. This android stuff is awesome and fun.
Thanks again and I like your attitude
BUMP:
So any last ideas on what could be wrong with ADB not working?
I don't blame you if you are stumped at this point.
PS:
At this point I am desperate, so feel free to even ask me noob questions such as .....Did I connect the device to the computer. I won't be offended you guys are a real help.
HandyAndyXDA said:
BUMP:
So any last ideas on what could be wrong with ADB not working?
I don't blame you if you are stumped at this point.
PS:
At this point I am desperate, so feel free to even ask me noob questions such as .....Did I connect the device to the computer. I won't be offended you guys are a real help.
Click to expand...
Click to collapse
UPDATE:
I tried
adb reboot-bootloader
and that worked so why dont
pull
work?

ADB Push/Pull simple guide

ADB Push/Pull Simple Guide​To Push a single file from PC to Android, in this case a ROM.zip, you must place the ROM.zip inside the same folder as your ADB and Fastboot files. Right click anywhere inside that folder while holding the shift key down to open the cmd prompt and run these commands:
adb devices
adb push ROM.zip /sdcard​
To Push multiple files at once using a single command do this:
In your SDK/Platform-tools folder, or whever you have your ADB files, create a folder called "tmp"
Place all the files you want to push into the tmp folder then run this command:
adb devices
adb push tmp /sdcard​
--Simple eh?
To Pull a file (In this case a TWRP backup located on the sdcard in a Subfolder of TWRP called BACKUPS) from device to PC or HARDDRIVE.:
Create a folder inside SDKplatform tools or where ever you have your ADB located. I call mine TWRP_Pulls. Inside that folder create a subfolder and give it the name of the backup/File you are pulling. In my case I name the folder by the backups date and numbers.
FOLDER Inside the ADB folder-->TWRP_Pulls
FOLDER Inside TWRP_Pulls-->2016-05-03--17-54-24​The full command would look like this:
adb pull /sdcard/TWRP/BACKUPS/ANDROIDSERIAL/2016-05-03--17-54-24_cm_surnia-userdebug_6.0.1_MHC19Q_bdf9ce04cf C:\Users\Name\Desktop\SDK\platform-tools\TWRP_Pulls\2016-05-03--17-54-24​
(Where ANDROIDSERIAL is your devices serial number and can be found by entering "adb devices")
Make sure you place a space between the first pull and the /sdcard and another one after the ROM.zip and before the <path to location>
adb pull[Space]/sdcard/TWRP/BACKUPS/ANDROIDSERIAL/
2016-05-03--17-54-24_cm_surnia-userdebug_6.0.1_MHC19Q_bdf9ce04cf[SPACE]C:\Users\Name\Desktop\SDK\platform-tools\TWRP_Pulls\2016-05-03--17-54-24​============================================================
CREATED BY: BillyMumphry for educational purposes only. I hope it will help some people as I know I sure fumbled with these Push Pull commands when I was learning.
------------------------------------------------------------------------------------------------------------
* If anyone has any questions or additions fell free to comment or PM or email me:​[email protected]​

Categories

Resources