2012-02-08 51 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