title: Questions about the new auto-backup feature of Android M
body: <h2>background</h2>
  
  <p>Google has introduced a nice new feature on Android M that allows you to backup and restore apps, even using ADB , as shown on <a href="https://www.youtube.com/watch?v=dcmNjbCNvA8" rel="nofollow"><strong>this video</strong></a> .</p>
  
  <p>It seems all you have to do is use the <code>adb shell bmgr</code> command to backup and restore apps, as such:</p>
  
  <p>backup:</p>
  
  <pre><code>adb shell bmgr fullbackup PACKAGE_NAME
  </code></pre>
  
  <p>restore an app:</p>
  
  <pre><code>adb shell bmgr restore PACKAGE_NAME
  </code></pre>
  
  <p>And it works well.</p>
  
  <h2>The problem</h2>
  
  <p>The docs are quite in their new phase, so I can't find answers to some questions about this new tool.</p>
  
  <h2>What I've tried</h2>
  
  <p>When typing the <code>adb shell bmgr</code>, I get some clues about how to use it, but I can't find the answers to the questions. Not having a device with Android M , but an emulator instead, I guess it will work differently. </p>
  
  <p>Here's what's written when typing this command:</p>
  
  <blockquote>
    <p>usage: bmgr [backup|restore|list|transport|run]
           bmgr backup PACKAGE
           bmgr enable BOOL
           bmgr enabled
           bmgr list transports
           bmgr list sets
           bmgr transport WHICH
           bmgr restore TOKEN
           bmgr restore TOKEN PACKAGE...
           bmgr restore PACKAGE
           bmgr run
           bmgr wipe TRANSPORT PACKAGE
           bmgr fullbackup PACKAGE...</p>
    
    <p>The 'backup' command schedules a backup pass for the named package.
    Note that the backup pass will effectively be a no-op if the package
    does not actually have changed data to store.</p>
    
    <p>The 'enable' command enables or disables the entire backup mechanism.
    If the argument is 'true' it will be enabled, otherwise it will be
    disabled.  When disabled, neither backup or restore operations will be
    performed.</p>
    
    <p>The 'enabled' command reports the current enabled/disabled state of
    the backup mechanism.</p>
    
    <p>The 'list transports' command reports the names of the backup
    transports currently available on the device.  These names can be
    passed as arguments to the 'transport' and 'wipe' commands.  The
    currently active transport is indicated with a '*' character.</p>
    
    <p>The 'list sets' command reports the token and name of each restore set
    available to the device via the currently active transport.</p>
    
    <p>The 'transport' command designates the named transport as the
    currently active one.  This setting is persistent across reboots.</p>
    
    <p>The 'restore' command when given just a restore token initiates a
    full-system restore operation from the currently active transport.  It
    will deliver the restore set designated by the TOKEN argument to each
    application that had contributed data to that restore set.</p>
    
    <p>The 'restore' command when given a token and one or more package names
    initiates a restore operation of just those given packages from the
    restore set designated by the TOKEN argument.  It is effectively the
    same as the 'restore' operation supplying only a token, but applies a
    filter to the set of applications to be restored.</p>
    
    <p>The 'restore' command when given just a package name intiates a
    restore of just that one package according to the restore set
    selection algorithm used by the RestoreSession.restorePackage()
    method.</p>
    
    <p>The 'run' command causes any scheduled backup operation to be
    initiated immediately, without the usual waiting period for batching
    together data changes.</p>
    
    <p>The 'wipe' command causes all backed-up data for the given package to
    be erased from the given transport's storage.  The next backup
    operation that the given application performs will rewrite its entire
    data set. Transport names to use here are those reported by 'list
    transports'.</p>
    
    <p>The 'fullbackup' command induces a full-data stream backup for one or
    more packages.  The data is sent via the currently active transport.</p>
  </blockquote>
  
  <h2>The questions</h2>
  
  <p>I have a few questions:</p>
  
  <ol>
  <li><p>Suppose I call those commands via the device itself, will they work? If not, will they work on a rooted device? Or at least backup&amp;restore the current app (app X backups&amp;restores itself) ? </p></li>
  <li><p>Where are the backups being stored? Is it possible to store them into a customized path ? Maybe even the one of the PC ? </p></li>
  <li><p>Is it possible to backup the same app into multiple states? For example, an app could have a backup for when it has logged in, and a backup for when it has some settings being configured. This way, you could restore to each of those backups.</p></li>
  <li><p>They write in the above description about "currently active transport" . What is it exactly ? Can it be customized?</p></li>
  <li><p>Is it possible to run a backup/restore on all apps? Or should I put the packages of all apps?</p></li>
  <li><p>It seems the "fullbackup" does the backup right away. What does the "run" attribute used for? Or maybe that's all because I use an emulator?</p></li>
  </ol>