【原创】AppleMobileBackup.exe调用

itunesbackup

写iTunes自动带密码备份工具(先带密码备份然后去除密码,解析备份文件可以得到keychain中保存到密码)的时候研究的,直接调用iTunes自有程序,可以省去第三方库的麻烦。

 

C:\Program Files (x86)\Common Files\Apple\Mobile Device Support>appleMobilebackup.exe

Action (one required):

-b, --backup             perform a backup        执行备份

-r, --restore            perform a restore        执行恢复

-C, --change password    change backup password from the given old password    提供旧密码,修改密码

-e, --extract path       extracts a relative path to the current directory    释放一个相对路径到当前目录

-R, --remove path        removes a relative path from the backup    从备份移动一个相对路径

-f, --filename path      prints the filename in a backup of a relative path    从相对路径的备份打印文件名

-i, --info               display info about a backup    显示默认路径下所有备份文件信息列表,选择一个可以显示出所有备份信息和应用信息,要求要硬件连在电脑上

-l, --list               list the contents of the backup    和-i基本一样,只是更加详细

Options:

-d, --device deviceid    device identifier (defaults to lockdown)

-t, --target deviceid    target device identifier

-s, --source deviceid    source device identifier 源设备,要备份的设备

-P, --password password  optional password when changing password or extractin

g files

-D, --domain name        domain name for --extract (default "HomeDomain")

-q, --root path          root backup directory

-o, --output path        output file for action (not logging)

-h, --help               print this message and exit

举例:

加入密码:

1)原来有密码,假如是1111,改成1112,则:

AppleMobileBackup -s 49486ae9ef2028ffd132554bd797baccf38c6603 –C 1111 –P 1112

2)原来的密码为空,改成1113,则:

AppleMobileBackup -s 49486ae9ef2028ffd132554bd797baccf38c6603 –C 1111 –P 1113

(上面的1111可以是任意的数字)

清除密码:

1)原来有密码,假如是1111,则:

AppleMobileBackup -s 49486ae9ef2028ffd132554bd797baccf38c6603 –C 1111

2)原来的密码为空,则即使执行下面的命令也不会出错,也不会有变化:

AppleMobileBackup -s 49486ae9ef2028ffd132554bd797baccf38c6603 –C 1111

(上面的1111可以是任意的数字)

备份:

C:\Program Files (x86)\Common Files\Apple\Mobile Device Support>AppleMobileBackup -s 49486ae9ef2028ffd132554bd797baccf38c6603 -b -q f:\ipad1

禁止备份:

Device Backups Disabled

Mac: defaults write com.apple.iTunes DeviceBackupsDisabled -bool YES
Win: "%ProgramFiles%\iTunes\iTunes.exe" /setPrefInt DeviceBackupsDisabled 1

参考:http://theiphonewiki.com/wiki/ITunes_Modes