我的Android手机上有 adb bakup 的问题 - 它是联想Vibe Shot Z90a40,Android版 5.1 。我正在尝试备份Viber,但问题也发生在其他软件包和完整备份上。生成的 .ab 文件的大小总是大约40个字节。
我已创建 .bat 脚本,执行 logcat 以查看设备中发生的情况:
@echo off
echo Connecting.
"%~dp0adb" version
"%~dp0adb" kill-server
"%~dp0adb" wait-for-device
"%~dp0adb" shell am force-stop com.viber.voip
echo Enter Backup My Data on Android phone screen.
"%~dp0adb" backup -f "%~dp0viber.ab" com.viber.voip
ping -n 10 127.0.0.1>nul
"%~dp0adb" shell logcat -d > "%~dp0log.txt"
"%~dp0adb" kill-server
echo "press any key to exit."
pause
我在日志错误消息中看到,它告诉我没有足够的可用空间:
I/BackupManagerService( 1136): --- Performing full-dataset adb backup ---
I/BackupManagerService( 1136): Initiating bind of OBB service on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971
W/ContextImpl( 1136): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1809 com.android.server.backup.BackupManagerService$FullBackupObbConnection.establish:2998 com.android.server.backup.BackupManagerService$PerformAdbBackupTask.run:3620 java.lang.Thread.run:818 <bottom of call stack>
E/Cryptfs ( 304): not running with encryption, aborting
I/BackupManagerService( 1136): OBB service connection com.android.internal.backup.IObbBackupService$Stub$Proxy@22da70c4 connected on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971
D/BackupManagerService( 1136): Binding to full backup agent : com.viber.voip
W/BackupManagerService( 1136): ensureAvailableSpace
D/BackupStrogeUtils( 1136): freeCacheStorage bytes=230686720
D/BackupStrogeUtils( 1136): freeCacheStorage Start bytes:230686720
D/BackupStrogeUtils( 1136): listFilesRecursive start uid=1000
D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_log_r file.stat.st_uid=0
D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_install file.stat.st_uid=0
D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_locale file.stat.st_uid=0
D/BackupStrogeUtils( 1136): freeCacheStorage Found 0 on cache
D/BackupStrogeUtils( 1136): freeCacheStorage End
D/BackupStrogeUtils( 1136): Not enough free space; 230686720 requested, 220848128 available
D/BackupManagerService( 1136): backupOnePackage ensureAvailableSpace failed : com.viber.voip
D/BackupManagerService( 1136): Full backup processing complete.
D/bu (26755): Finished.
但我在设备上有很多可用空间。我执行了 df 命令:
@echo off
"%~dp0adb" kill-server
"%~dp0adb" shell df > df.txt
"%~dp0adb" kill-server
echo Done!
pause
结果如下:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Filesystem Size Used Free Blksize
/dev 1.4G 76.0K 1.4G 4096
/sys/fs/cgroup 1.4G 12.0K 1.4G 4096
/mnt/asec 1.4G 0.0K 1.4G 4096
/mnt/obb 1.4G 0.0K 1.4G 4096
/system 1.9G 1.7G 255.5M 4096
/data 25.4G 12.3G 13.1G 4096
/preload 387.4M 127.5M 259.9M 4096
/cache 248.0M 220.0K 247.7M 4096
/persist 27.5M 184.0K 27.3M 4096
/firmware 64.0M 51.1M 12.9M 16384
/mnt/shell/emulated 25.3G 12.3G 13.1G 4096
/storage/emulated/legacy 25.3G 12.3G 13.1G 4096
/storage/sdcard0 25.3G 12.3G 13.1G 4096
我在 / data 分区上有近13GB的免费空间。奇怪的情况是备份恢复功能正常,我成功将viber包从我的旧手机转移到这款手机。
我找到了类似的thread并使用adb的 1.0.31 和 1.0.32 两个版本进行了测试,但结果是相同的。 有谁知道出了什么问题? 任何帮助表示赞赏。
提前致谢
答案 0 :(得分:1)
在引用 this SO thread 中所述的 ADB 参数后,备份开始为我工作。
例如:
<块引用>adb 备份“-apk -shared -all -f backup.ab”
我确实使用了 1.0.31,但它可能不是原因。