1
我是mac开发新手。我必须通过命令进行iPhone备份。有一个关于这个网站的解释(http://keepmurmuring.blogspot.com/2009/06/iphone-backup-informationnote.html)。我尝试使用参数执行脚本“System/Library/PrivateFrameworks/MobileDevice.framework/Resources/AppleMobileDeviceHelper.app/Contents/Resources/AppleMobileBackup”。但是我无法访问这个路径并且出现错误“启动路径不可访问”。任何人都可以帮助我访问路径并完成我的任务。从Mac执行脚本
NSString *_filename [email protected]"System/Library/PrivateFrameworks/MobileDevice.framework/Resources/AppleMobileDeviceHelper.app/Contents/Resources/AppleMobileBackup";
NSArray *arguments = [NSArray arrayWithObjects: @"./ambackup",
@"--backup", @"--target", @"BE1F74EEB98E14D426665D54105DE27821A6C0FE", nil];
NSTask *task = [[NSTask alloc] init];
NSPipe *pipe = [NSPipe pipe];
NSFileHandle *readHandle = [pipe fileHandleForReading];
NSData *temp = nil;
NSMutableData *_data = [[NSMutableData alloc] init];
[task setLaunchPath:_filename];
[task setArguments:arguments];
[task setStandardOutput:pipe];
[task launch];
while ((temp = [readHandle availableData]) && [temp length])
{
[_data appendData:temp];
}
[task release];