[Galaxy Tab General] enoola:
Backup Android 4.0.3, devices (GTab 2 7", GT-P3100, GT-P3113) [Massive Deployments]

Hello,

there isn't much article out here about adb backup so below are my notes.

French version of this article attached / version Française attachée.

Objective : Massively deploy android devices, most MDM vendors doesn’t propose everything to be configured remotely so a good option could be to first make a ghost of a device and massively provision it to our fleet, we can leverage this step to install our MDM* client too.This approach is also costless.

Means : Android dev. offers ADB backup/restore great tools to achieve this, nevertheless if not used carefully it can leads to some problems specialy regarding identifiers generated along software installation, if those are duplicated you can easily and up with some conflicts your Mail server depending on how ActiveSync is managed.

We have some benefits using such tools.

- Human error could be important,

- Tracking is much easier when automatized

- Definitely more efficient to industrialize such process

So the idea is to take one device, set it to be configured with expected settings for the whole fleet, usually we will remove some icons, change background screen, change lock screen wallpaper, eventually save SDCard or sharedspace content.

Once your “target” device is configured you will backup what we are interested in ONLY. Rather than using the common “adb backup -all", REALLY useful for personal backups_The long typing of this command is: [FONT]“adb backup –noapk –shared –system –all”[/FONT]

Reference of this command: http://xdaforums.com/showthread.php?t=1420351

Again, we are speaking of massive deployment so any soft identifiers generated upon certain software installation shall not be duplicated, therefore some softwares aren’t meant to be backed up.

For example with ICS Samsung the ActiveSyncID is generated regarding different criteria when this App is populated. So you do NOT want to backup com.android.email. We could also think of an App that changes wifi mac addr .. Why bothering ? Because the concept of an Identifier is to be unique, and some solutions critically rely on it.

Why ? Simply because you will end up with a duplicated activesync ID .

To see the ActiveSync ID of a device go to email application and start to set a dumb account (or a real one) as described in step 'B.f.2)'

For this matter it is definitely safest to NOT use -system option with “adb backup” for massive deployments

.

This article doesn’t engage me. I won’t be responsible if damages are caused to your device(s).

use it intelligently. e.g: Do not restore a backup on a different type of device.

A.	Prerequisite to go on :

1)	Install Java JDK >= 6 : http://www.oracle.com/technetwork/java/javase/downloads/index.html

2)	Download Android SDK Platform to benefit from Android Debug Bridge tool (adb)

here : http://developer.android.com/tools/help/adb.html

download : http://developer.android.com/sdk/index.html

this document was written with SDK Revision 21, ADB coming with it :

<androidsdk>\sdk4.2\platform-tools>adb.exe version

Android Debug Bridge version 1.0.31​

3)	Once downloaded unzip the sdk archive somewhere, in this tuto : “<androidsdk>/”

4)	Add “<androidsdk>/platform-tools” to the system PATH

a. cf: http://msdn.microsoft.com/en-us/library/ee537574%28v=office.14%29.aspx

5)	make sure USB Debug is enabled on your device

B. Backup

1) See OriginalState.zip, some screenshot of what the device looks like once we passed first Android wizard on first boot

2) See TargetConfiguration.zip, some screenshots to show the expected visual result of our backup

B.a - ADB Backup Synopsis :

adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>]​

Detailed here: http://xdaforums.com/showthread.php?t=1420351

B.b - Things to Backup:

Let’s just replicate simple configurations, WIFI & such config would also make senses depending the way it is implemented on customer site.

Useful information about different packages:	http://chomikuj.pl/Koko35/ANDROID+*e2*99*a5+*e2*99*a5+*e2*99*a5/Samsung+GALAXY+S+III+GT-I9300/Samsung+Galaxy+S3+-+Applications+safe+to+remove,1918452384.pdf

B.c - Expected configurations to be backup

Expected package : action

No Google account defined : keep it this way

USB Debug enabled	: manualy Go to Param./Security/ & Check "Unknown sources"

USB Debug enabled	: manualy Go to Param./Security/ & Check "Unknown sources"

Icons displayed, hidden, place …. : com.sec.android.app.launcher

Wall paper lock screen & settings : com.android.settings, com.sec.android.gallery3d

Shared folders	: -shared, com.android.sharedstoragebackup

Application added : manually enable install from unknown source & install com.myapp

backup APKs : -apk

DO NOT Backup whole system	: -nosystem

B.d - Backup command line :

We do come up with the below invokation:

<androidsdk>\platform-tools>adb.exe wait-for-devices

<androidsdk>\platform-tools>adb.exe backup –f "20121209_bkp_GTab2_GTP3100_FR_4.0.3_launcher_wallpaper_lockscreen_SD_zenprise_apks_2.ab" -apk -shared -nosystem com.sec.android.app.launcher com.android.settings com.sec.android.gallery3d com.myapp com.android.sharedstoragebackup​

B.e - Restoration

Take another device plug it to the computer and type the below command to restore your fresh “ghost”,

<androidsdk>\platform-tools>adb.exe wait-for-devices

<androidsdk>\platform-tools>adb.exe restore "20121209_bkp_GTab2_GTP3100_FR_4.0.3_launcher_wallpaper_lockscreen_SD_zenprise_apks_2.ab"
​

B.f - Tips

1)

Only save icons positions, hidden states.. :

<androidsdk>\platform-tools>adb.exe backup -f 20121209_bkp_launcher_wallpaper.ab -noapk -noshared -nosystem com.sec.android.app.launcher com.android.settings​

2)

Get Exchange Active Sync ID of my Samsung Device

See FindOut_ActiveSyncID.zip

1) Open E-Mail app.

2) If no account is set you get a screen to complete, type dummy info, click on Next (top right)

3) Click Microsoft Exchange Active Sync

4) Click on > Next (top right)

5) Click on Modify details

6) Finally we get the ActiveSync ID​

B.g - Limitations / Questions :

- Deactivated services aren’t backup during such an operation. (didn’t tried with –ALL though, any idea? )

- You want to have control scripts and such to verify that data integrity, some manual verifications could also be performed to control the quality.

- Q: I do type my command but I end up with few kb, depending on what you did put it could be much than that ??

. A: Be sure you respected the order indicated in the command line synopsis:

adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>] ​

- Q: I removed apps prior to backup, when doing hard reset and restore it stays is that normal ?

. A: Indeed it is, to aniliate some applications (if they can manualy be remove you will be able to remove it using ADB uninstall)
​

John PIGERET.