Android adb Goodness

Thanks to the Ubuntu Touch install page I found out that you can do a full Android backup of apps and data.

Backup

adb backup -apk -shared -all

That will create a backup.ab file on your computer which can get huge

Restore

adb restore backup.ab

Restoration can be done even on a different ROM and it even maintains settings apps which require you to log in.

Full details of adb backup are as follows and you could selectively backup important app data and such.

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.)

Another great adb command is screen recording which I believe is only in Android 4.4 (KitKat) and above

adb shell screenrecord /sdcard/test.mp4

Ctrl+C to stop recording the video

If you have multiple devices connected, use -s deviceID to spec

adb devices
# List of devices attached
# 00bb1122 device
# 0022334455 device
adb -s 0063686250152c5a shell
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s