gpt4 book ai didi

android - 关于Android M新的自动备份功能的问题

转载 作者:行者123 更新时间:2023-12-02 15:39:53 25 4
gpt4 key购买 nike

背景

Google 在 Android M 上引入了一项不错的新功能,允许您备份和恢复应用程序,甚至可以使用 ADB,如 this video 所示。 .

看来您所要做的就是使用adb shell bmgr命令来备份和恢复应用程序,如下所示:

备份:

adb shell bmgr fullbackup PACKAGE_NAME

恢复应用程序:

adb shell bmgr restore PACKAGE_NAME

而且效果很好。

问题

这些文档还处于新阶段,因此我找不到有关此新工具的一些问题的答案。

我尝试过的

当输入adb shell bmgr时,我得到了一些关于如何使用它的线索,但我找不到问题的答案。没有安装 Android M 的设备,而是使用模拟器,我想它的工作方式会有所不同。

以下是键入此命令时写入的内容:

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

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.

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.

The 'enabled' command reports the current enabled/disabled state of the backup mechanism.

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.

The 'list sets' command reports the token and name of each restore set available to the device via the currently active transport.

The 'transport' command designates the named transport as the currently active one. This setting is persistent across reboots.

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.

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.

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.

The 'run' command causes any scheduled backup operation to be initiated immediately, without the usual waiting period for batching together data changes.

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

The 'fullbackup' command induces a full-data stream backup for one or more packages. The data is sent via the currently active transport.

问题

我有几个问题:

  1. 假设我通过设备本身调用这些命令,它们会起作用吗?如果没有,它们可以在 root 设备上运行吗?或者至少备份和恢复当前应用程序(应用程序 X 备份和恢复本身)?

  2. 备份存储在哪里?是否可以将它们存储到自定义路径中?甚至可能是 PC 机之一?

  3. 是否可以将同一个应用程序备份到多个状态?例如,应用程序可以在登录时进行备份,并在配置某些设置时进行备份。这样,您就可以恢复每个备份。

  4. 他们在上面的描述中写到了“当前 Activity 的传输”。究竟是什么 ?可以定制吗?

  5. 是否可以在所有应用程序上运行备份/恢复?还是应该把所有应用程序的包都放上去?

  6. “完整备份”似乎立即进行备份。 “run”属性有什么用?或者也许这都是因为我使用模拟器?

最佳答案

如果您还没有看过它们,这里是 reference documents了解与自动备份相关的新功能。备份功能存在于以前的版本中,并在本 guide 中进行了描述。 。我曾与他们合作开发 KitKat。快速浏览一下,M Preview 中的新功能如下:

  1. 每日自动备份
  2. 用于配置和控制备份内容的更多选项。

您的大部分问题都集中在 adb shell bmgr 工具上。供开发人员测试。在正常的设备使用中,当设备空闲、充电并连接到 Wi-Fi 网络时,备份会每 24 小时自动完成一次。

Suppose I call those commands via the device itself, will they work?

既然备份是自动完成的,那真的有必要吗?

Where are the backups being stored? Is it possible to store them into a customized path ? Maybe even the one of the PC ?

存储到用户的 Google 云端硬盘帐户。号号号

They write in the above description about "currently active transport" . What is it exactly ? Can it be customized?

由 Google 提供。不这么认为。

Is it possible to run a backup/restore on all apps? Or should I put the packages of all apps?

默认情况下,所有应用程序都会备份。引用文档描述了如何限制所包含的内容。

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?

除了新的自动备份功能之外,应用程序还可以执行增量备份,如上述指南中所述。提供run命令用于测试,以允许开发人员强制立即激活增量备份处理。

关于android - 关于Android M新的自动备份功能的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31071926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com