【发布时间】:2015-01-01 02:30:02
【问题描述】:
我想通过我的 cocoa 应用使用 instrument 来在我的 iOS 模拟器上安装 .app。
这是我第一次开发可可应用程序和 NSTask。 NSTask 需要一个启动路径,在我的情况下它是无关紧要的,因为这个命令可以从任何地方运行。 这是我要运行的命令:
instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -w "iPad Retina (7.1 Simulator)" ""
目前我有这个:
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/"];
NSString * commandTorun = @"instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -w \"iPad Retina (7.1 Simulator)\" \"<path to .app>" ";
NSArray *arguments = [NSArray arrayWithObjects:
@"-t" ,
[NSString stringWithFormat:@"%@", commandTorun],
nil];
NSLog(@"Run command:%@",commandTorun);
[task setArguments:arguments];
[task launch];
任何帮助将不胜感激。
谢谢,
【问题讨论】:
标签: objective-c xcode cocoa instruments nstask