2

我一直在尝试从命令行运行 Instruments。但它失败并出现以下错误:

2012-02-08 14:48:16.104 instruments[94502:60f] -[NSAlert alertWithError:] called 
    with nil NSError. A generic error message will be displayed, 
    but the user deserves better. 

Wed Feb  8 14:48:16 c1dev-dm23409.overstock.com instruments[94502] 
    <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection 

Wed Feb  8 14:48:16 c1dev-dm23409.overstock.com instruments[94502] 
    <Error>: kCGErrorFailure: Set a breakpoint @CGErrorBreakpoint() to catch errors as 
    they are logged. 

2012-02-08 14:48:16.137 instruments[94502:60f] Recording cancelled : At least 
    one target failed to launch; aborting run

有人能告诉我我错过了什么吗?

4

1 回答 1

1

我相信错误Invalid connection和以下Set a breakpoint...是 Instruments 在遇到任何问题时的响应。

真正重要的是最后一行:Recording cancelled : At least one target failed to launch.

根据我的经验,这要么意味着您的程序无法加载(配置配置文件、不存在的构建等),要么意味着您没有在命令行上正确指定它。这是我指定的方式instruments

$ instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate 
    /path/to/my/AppName.app -e UIARESULTSPATH . -e UIASCRIPT testscript.js
于 2012-05-07T22:21:48.897 回答