启动屏幕出现并在定位模拟器时反复消失

时间:2015-03-31 09:20:08

标签: ios xcode instruments ui-automation

当我启动应用程序时,屏幕出现并再次消失。我用UI Automation

编写了一个小脚本
instruments -w "iPhone 6 (8.2 Simulator)" -t /Applications/Xcode-beta.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate /Users/me/PATHTO.app -e UIASCRIPT "/Users/me/Documents/Instrument/test.js" -e UIARESULTSPATH "/somewhere"

我收到了这个错误:

instruments[1940:183752] WebKit Threading Violation - initial use of WebKit from a secondary thread.
Instruments Trace Error : Target failed to run: Failed looking up pid of launched process.

任何想法?

1 个答案:

答案 0 :(得分:0)

这可能是最接近回答问题的问题:您是否确认您的应用在发布期间确实没有崩溃?与OS X不同,iOS中的崩溃不能很好地宣传自己,因此除非您打开日志,否则通常很难弄清楚是否真的发生了崩溃。

这些并不是一个解决方案,但如果应用程序没有崩溃,可能会对自己进行调试有所帮助:

模拟器有自己的控制台日志,可能包含有关发生的事情的详细信息,例如提及您的应用程序异常退出或发出断言或类似内容。

我相信WebKit Threading Violation是一个红色的鲱鱼。自从Xcode 6测试版以来,我对Apple有一个关于它的错误,即使我们现在认为Xcode 7.1还没有修复,但据我所知,它只是噪音。我个人有一个围绕仪器命令行的包装器,它会将信息从仪器的输出中剥离出来,因为有太多人对它感到困惑。

此外,乐器具有instruments -v的详细输出选项,可能会提供更多详细信息。

instruments -v -w "iPhone 6 (8.2 Simulator)" -t /Applications/Xcode-beta.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate /Users/me/PATHTO.app -e UIASCRIPT "/Users/me/Documents/Instrument/test.js" -e UIARESULTSPATH "/somewhere"