Command line iPhone backup on PC

I have a need to do a complete backup of an iPhone, but I need to do it from a command line. Currently I am able to detect the device and obtain the device ID and pass that to AppleMobileBackup. I get a backup to execute and it's the same as when I do it natively with iTunes GUI except it's missing info.plist. I am guessing it's because I never get the opportunity to tell it to encrypt the backup (which I am not trying to circumvent. I prefer that it be encrypted)


The command that I am executing is: C:\Program Files (x86)\Common Files\Apple\Mobile Device Support\AppleMobileBackup.exe --backup --target %40_digit_device_identifier% --root %path_where_I_want_data_stored%


It seems like I am just missing a command line parameter to pass that would enable encryption but there isn't an option that I have been able to find that tells gives me any additional information. If anyone can help with this I would appreciate it. I seem to have hit a dead end.


Thanks!

Replies

You might have more luck asking this over on Apple Support Communities. From a developer perspective there is certainly no API to run a backup, even on Apple platforms.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

OK thanks, I will give that a try.

AppleMobileBackup seems like it'll work on the on the cli, but it actually doesn't.

It has this really awesome help page that lures you in:

Code Block
$ /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/Current/AppleMobileDeviceHelper.app/Contents/Resources/AppleMobileBackup --help
Action (one required):
-b, --backup perform a backup
-r, --restore perform a restore
-E, --erase erase target device
-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
-I, --create-info create a placeholder Info.plist file
-l, --list list the contents of the backup
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 extracting files
-N, --no-pass-prompt ignore terminal prompt for password
-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


But I haven't gotten it to do anything with my encrypted backup. Very silent when it errors. Though if you check the console log you'll get slightly more insight.