2012-02-08 47 views
3

如何从命令行运行iOS自动化(iPhone/iPad)的苹果乐器?我看到一些博客说,下面的命令从终端运行Apple自动化仪器

instruments -w -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -e UIASCRIPT 

我一直没有能够得到这个运行。

  • 有没有人得到这个运行?
  • 如果您是从终端运行它,您可以请分享步骤吗?

回答

3

通过参数以方便您阅读爆发:

mkdir TestResults 

instruments 
-D TestResults/TestTrace/theTrace.trace 
-t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate 
/Absolute/Path/to/built/app/For/Simulator/AppName.app 
-e UIARESULTSPATH TestResults/ 
-e UIASCRIPT Tests/some_test_file.js 
+0

我试图运行上面的命令。但Insutruments无法运行。它扔以下错误: – 2012-02-08 21:47:43

+2

仪器[94502:60F] - [NSAlert alertWithError :]用nil NSError调用。一般的错误信息会显示出来,但用户应该更好。 Wed Feb 8 14:48:16 c1dev-dm23409.overstock.com instruments [94502] :kCGErrorInvalidConnection:CGSGetCurrentCursorLocation:无效连接 Wed Feb 8 14:48:16 c1dev-dm23409.overstock.com instruments [94502] : kCGErrorFailure:设置一个断点@CGErrorBreakpoint()以便在记录时捕获错误。2012-02-08 14:48:16.137 [94502:60f]录制取消:至少有一个目标无法启动;堕胎运行 你见过这个> – 2012-02-08 21:52:36

+1

我已经看到了。确保文件夹存在于'-D'和'-e UIARESULTSPATH'标志中指定的输出目录中。另外,确保没有现有文件指向'-D'标志。 – 2012-02-08 22:10:00