WebKit Threading Violation - initial use of WebKit from a secondary thread in UI Automation

末鹿安然 提交于 2019-12-21 20:26:06

问题


When I tried to run my automation scripts through the terminal with Xcode 6 I got this error message:

WebKit Threading Violation - initial use of WebKit from a secondary thread. 

Can someone help me to run the automation scripts through terminal or instrument in Xcode 6.


回答1:


I see the same message infrequently -- even when things run successfully.

You may be having troubles running instruments from command line because of changes to command line utilities for XCode 6.

Check out UIAutomation test invocation from the command line with Xcode 6

adding the -w flag made things work again for me. i.e.

-w "Resizable iPad (8.0 Simulator)"

Also, make sure you're passing the -w before the path to the app file:

instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate" -w "iPad Air (8.0 Simulator)" "/path/to/My.app" -e UIASCRIPT "scriptola.js"

Here's a list of devices:

  • Resizable iPad (8.0 Simulator)
  • Resizable iPhone (8.0 Simulator)
  • iPad 2 (7.1 Simulator)
  • iPad 2 (8.0 Simulator)
  • iPad Air (7.1 Simulator)
  • iPad Air (8.0 Simulator)
  • iPad Retina (7.1 Simulator)
  • iPad Retina (8.0 Simulator)
  • iPhone 4s (7.1 Simulator)
  • iPhone 4s (8.0 Simulator)
  • iPhone 5 (7.1 Simulator)
  • iPhone 5 (8.0 Simulator)
  • iPhone 5s (7.1 Simulator)
  • iPhone 5s (8.0 Simulator)
  • iPhone 6 (8.0 Simulator)
  • iPhone 6 Plus (8.0 Simulator)



回答2:


I was facing the same issue , I resolved it by following steps :

Check ur UIAutomation is enabled or not in the device ? -> To check it , Go to settings -> Developer -> Enable UIAutomation

restart your device , and then again try. It works for me ... :)



来源:https://stackoverflow.com/questions/25919234/webkit-threading-violation-initial-use-of-webkit-from-a-secondary-thread-in-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!