WebKit Threading Violation - initial use of WebKit

2020-07-22 15:52发布

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.

2条回答
甜甜的少女心
2楼-- · 2020-07-22 16:41

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 ... :)

查看更多
【Aperson】
3楼-- · 2020-07-22 16:46

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)
查看更多
登录 后发表回答